Package org.alfresco.repo.module.tool
Class WarHelperImpl
- java.lang.Object
-
- org.alfresco.repo.module.tool.WarHelperImpl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMANIFEST_COMMUNITYstatic java.lang.StringMANIFEST_FILEstatic java.lang.StringMANIFEST_IMPLEMENTATION_TITLEstatic java.lang.StringMANIFEST_SHAREstatic java.lang.StringMANIFEST_SPECIFICATION_TITLEstatic java.lang.StringMANIFEST_SPECIFICATION_VERSIONprotected static java.lang.StringREGEX_NUMBER_OR_DOTstatic java.lang.StringVERSION_PROPERTIES-
Fields inherited from interface org.alfresco.repo.module.tool.WarHelper
MODULE_CONFIG_IN_WAR, MODULE_NAMESPACE_DIR
-
-
Constructor Summary
Constructors Constructor Description WarHelperImpl(LogOutput log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringbackup(de.schlichtherle.truezip.file.TFile file)Backs up a given file or directory.voidcheckCompatibleEdition(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)This checks to see if the module that is being installed is compatible with the war.voidcheckCompatibleEditionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Checks to see if the module that is being installed is compatible with the war, (using the entry in the manifest).voidcheckCompatibleVersion(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Checks to see if the module is compatible with the version of Alfresco.protected voidcheckCompatibleVersionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Checks if the module is compatible using the entry in the manifest.voidcheckModuleDependencies(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Checks the dependencies of this modulejava.util.jar.ManifestfindManifest(de.schlichtherle.truezip.file.TFile war)Finds a single attribute from a war manifest file.protected java.lang.StringfindManifestArtibute(de.schlichtherle.truezip.file.TFile war, java.lang.String attributeName)Finds a single attribute from a war manifest file.protected ModuleDetailsgetModuleDetails(de.schlichtherle.truezip.file.TFile war, java.lang.String moduleId)Gets the module details for the specified module from the war.ModuleDetailsgetModuleDetailsOrAlias(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Gets the module details or an available aliasbooleanisShareWar(de.schlichtherle.truezip.file.TFile warFile)Indicates if the war file specified is a "Share" war.java.util.List<ModuleDetails>listModules(de.schlichtherle.truezip.file.TFile war)Lists all the currently installed modules in the WAR
-
-
-
Field Detail
-
VERSION_PROPERTIES
public static final java.lang.String VERSION_PROPERTIES
- See Also:
- Constant Field Values
-
MANIFEST_FILE
public static final java.lang.String MANIFEST_FILE
- See Also:
- Constant Field Values
-
MANIFEST_SPECIFICATION_TITLE
public static final java.lang.String MANIFEST_SPECIFICATION_TITLE
- See Also:
- Constant Field Values
-
MANIFEST_SPECIFICATION_VERSION
public static final java.lang.String MANIFEST_SPECIFICATION_VERSION
- See Also:
- Constant Field Values
-
MANIFEST_IMPLEMENTATION_TITLE
public static final java.lang.String MANIFEST_IMPLEMENTATION_TITLE
- See Also:
- Constant Field Values
-
MANIFEST_SHARE
public static final java.lang.String MANIFEST_SHARE
- See Also:
- Constant Field Values
-
MANIFEST_COMMUNITY
public static final java.lang.String MANIFEST_COMMUNITY
- See Also:
- Constant Field Values
-
REGEX_NUMBER_OR_DOT
protected static final java.lang.String REGEX_NUMBER_OR_DOT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WarHelperImpl
public WarHelperImpl(LogOutput log)
-
-
Method Detail
-
checkCompatibleVersion
public void checkCompatibleVersion(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Description copied from interface:WarHelperChecks to see if the module is compatible with the version of Alfresco.- Specified by:
checkCompatibleVersionin interfaceWarHelper- Parameters:
war- a valid war file or exploded directory from a war
-
checkCompatibleVersionUsingManifest
protected void checkCompatibleVersionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Checks if the module is compatible using the entry in the manifest. This is more accurate and works for both alfresco.war and share.war, however valid manifest entries weren't added until 3.4.11, 4.1.1 and Community 4.2- Parameters:
war- TFileinstallingModuleDetails- ModuleDetails
-
findManifestArtibute
protected java.lang.String findManifestArtibute(de.schlichtherle.truezip.file.TFile war, java.lang.String attributeName) throws ModuleManagementToolExceptionFinds a single attribute from a war manifest file.- Parameters:
war- the warattributeName- key name of attribute- Returns:
- attribute value
- Throws:
ModuleManagementToolException
-
findManifest
public java.util.jar.Manifest findManifest(de.schlichtherle.truezip.file.TFile war) throws ModuleManagementToolExceptionFinds a single attribute from a war manifest file.- Specified by:
findManifestin interfaceWarHelper- Parameters:
war- the war- Returns:
- Manifest
- Throws:
ModuleManagementToolException
-
checkCompatibleEdition
public void checkCompatibleEdition(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Description copied from interface:WarHelperThis checks to see if the module that is being installed is compatible with the war. If not module edition is specfied then it will just return. However, if an edition is specified and it doesn't match then an error is thrown.- Specified by:
checkCompatibleEditionin interfaceWarHelper- Parameters:
war- a valid war file or exploded directory from a warinstallingModuleDetails- ModuleDetails
-
checkCompatibleEditionUsingManifest
public void checkCompatibleEditionUsingManifest(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Checks to see if the module that is being installed is compatible with the war, (using the entry in the manifest). This is more accurate and works for both alfresco.war and share.war, however valid manifest entries weren't added until 3.4.11, 4.1.1 and Community 4.2- Parameters:
war- TFileinstallingModuleDetails- ModuleDetails
-
checkModuleDependencies
public void checkModuleDependencies(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)Description copied from interface:WarHelperChecks the dependencies of this module- Specified by:
checkModuleDependenciesin interfaceWarHelper- Parameters:
war- TFileinstallingModuleDetails- ModuleDetails
-
getModuleDetailsOrAlias
public ModuleDetails getModuleDetailsOrAlias(de.schlichtherle.truezip.file.TFile war, ModuleDetails installingModuleDetails)
Description copied from interface:WarHelperGets the module details or an available alias- Specified by:
getModuleDetailsOrAliasin interfaceWarHelper- Parameters:
war- a valid war file or exploded directory from a warinstallingModuleDetails- ModuleDetails- Returns:
- ModuleDetails
-
isShareWar
public boolean isShareWar(de.schlichtherle.truezip.file.TFile warFile)
Description copied from interface:WarHelperIndicates if the war file specified is a "Share" war. The default is FALSE Returns true if the Share war manifest states its a share war.- Specified by:
isShareWarin interfaceWarHelper- Parameters:
warFile- TFile- Returns:
- boolean - true if it is a share war
-
listModules
public java.util.List<ModuleDetails> listModules(de.schlichtherle.truezip.file.TFile war)
Lists all the currently installed modules in the WAR- Specified by:
listModulesin interfaceWarHelper- Parameters:
war- the war- Returns:
- an unordered list of module details.
- Throws:
ModuleManagementToolException
-
backup
public java.lang.String backup(de.schlichtherle.truezip.file.TFile file) throws java.io.IOExceptionBacks up a given file or directory.
-
getModuleDetails
protected ModuleDetails getModuleDetails(de.schlichtherle.truezip.file.TFile war, java.lang.String moduleId)
Gets the module details for the specified module from the war.- Parameters:
war- a valid war file or exploded directory from a warmoduleId- String- Returns:
- ModuleDetails
-
-