com.ibm.websphere.management.application
Class EarUtils
- java.lang.Object
-
- com.ibm.websphere.management.application.EarUtils
-
public class EarUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description EarUtils()
-
Method Summary
Methods Modifier and Type Method and Description static void
deleteDirTree(java.io.File dir)
Delete the directory tree speicfied by a File.static void
deleteDirTree(java.lang.String dir)
Delete the directory tree specified.static void
extractArchive(org.eclipse.jst.j2ee.commonarchivecore.internal.Archive arc, java.lang.String dirName, boolean bCleanup, int options)
static void
extractEar(com.ibm.etools.commonarchive.EARFile earFile, java.lang.String dirName, boolean bCleanup)
Save this EAR file as a directory using the specified uri.static void
extractEar(com.ibm.etools.commonarchive.EARFile earFile, java.lang.String dirName, boolean bCleanup, int options)
static void
extractEar(com.ibm.etools.commonarchive.EARFile earFile, java.lang.String dirName, boolean bCleanup, int options, java.util.Set<java.lang.String> expandOverrides)
Save this EAR file as a directory using the specified uri.static int
getAppVersionForDeployment(com.ibm.etools.commonarchive.EARFile ear)
Returns the application version contained in the deployment descriptor of the EAR.static org.eclipse.jst.j2ee.commonarchivecore.internal.Archive
getArchive(java.lang.String filePath, boolean useReflection, boolean isReadOnly)
static com.ibm.etools.commonarchive.EARFile
getEarFile(java.lang.String filePath, boolean useReflection)
Opens an EAR file in read/write mode.static com.ibm.etools.commonarchive.EARFile
getEarFile(java.lang.String filePath, boolean useReflection, boolean isReadOnly)
Opens an EAR file in read only or read/write mode.static int
getLowestNodeVersionForModule(org.eclipse.jst.j2ee.application.Module module)
Returns the lowest node version for the module.
-
-
-
Method Detail
-
getEarFile
public static com.ibm.etools.commonarchive.EARFile getEarFile(java.lang.String filePath, boolean useReflection) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException
Opens an EAR file in read/write mode.- Parameters:
filePath
- - Absolute path to the EAR file.useReflection
- - Indicator for whether auto java reflection should be turned on in the archive.- Returns:
- EARFile - Opened EAR file.
- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException
-
getEarFile
public static com.ibm.etools.commonarchive.EARFile getEarFile(java.lang.String filePath, boolean useReflection, boolean isReadOnly) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException
Opens an EAR file in read only or read/write mode.- Parameters:
filePath
- - Absolute path to the EAR file.useReflection
- - Indicator for whether auto java reflection should be turned on in the archive.isReadOnly
- - When true the EAR file is opened in read only mode.- Returns:
- EARFile - Opened EAR file.
- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException
-
getArchive
public static org.eclipse.jst.j2ee.commonarchivecore.internal.Archive getArchive(java.lang.String filePath, boolean useReflection, boolean isReadOnly) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException
- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException
-
extractEar
public static void extractEar(com.ibm.etools.commonarchive.EARFile earFile, java.lang.String dirName, boolean bCleanup) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException, java.io.IOException
Save this EAR file as a directory using the specified uri.- Parameters:
earFile
- EAR file to be extracted.dirName
- Directory to extract the EAR file into.bCleanup
- If directory tree exist then delete the tree before extracting- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException
java.io.IOException
-
extractEar
public static void extractEar(com.ibm.etools.commonarchive.EARFile earFile, java.lang.String dirName, boolean bCleanup, int options) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException, java.io.IOException
- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException
java.io.IOException
-
extractEar
public static void extractEar(com.ibm.etools.commonarchive.EARFile earFile, java.lang.String dirName, boolean bCleanup, int options, java.util.Set<java.lang.String> expandOverrides) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException, java.io.IOException
Save this EAR file as a directory using the specified uri.- Parameters:
earFile
- EAR file to be extracted.dirName
- Directory to extract the EAR file into.bCleanup
- If directory tree exist then delete the tree before extractingoptions
- - The Archive class contains the follow constants that can be ORed to together. EXPAND_NONE EXPAND_WAR_FILES EXPAND_EJBJAR_FILES EXPAND_APPCLIENT_FILES EXPAND_ARCHIVES EXPAND_RAR_FILES EXPAND_ALLexpandOverrides
- Full relative URI values of locations which must be saved as directories.- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException
java.io.IOException
-
extractArchive
public static void extractArchive(org.eclipse.jst.j2ee.commonarchivecore.internal.Archive arc, java.lang.String dirName, boolean bCleanup, int options) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException, java.io.IOException
- Throws:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException
java.io.IOException
-
deleteDirTree
public static void deleteDirTree(java.lang.String dir) throws java.io.IOException
Delete the directory tree specified.- Parameters:
dir
- - Absolute path of directory to delete.- Throws:
java.io.IOException
-
deleteDirTree
public static void deleteDirTree(java.io.File dir) throws java.io.IOException
Delete the directory tree speicfied by a File.- Parameters:
dir
- - A java.io.File which specifies the file to delete.- Throws:
java.io.IOException
-
getAppVersionForDeployment
public static int getAppVersionForDeployment(com.ibm.etools.commonarchive.EARFile ear)
Returns the application version contained in the deployment descriptor of the EAR.- Parameters:
ear
- - The EAR containing the deployment descriptor.- Returns:
- int - The application version as an int
-
getLowestNodeVersionForModule
public static int getLowestNodeVersionForModule(org.eclipse.jst.j2ee.application.Module module)
Returns the lowest node version for the module.- Parameters:
module
- - The module to containing the version information- Returns:
- int - The lowest version found in the module.
-
-