Package org.alfresco.repo.module.tool
Class ModuleDetailsHelper
- java.lang.Object
-
- org.alfresco.repo.module.tool.ModuleDetailsHelper
-
public class ModuleDetailsHelper extends java.lang.ObjectModule details helper used by the module mangement tool- Author:
- Roy Wetherall, Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description ModuleDetailsHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ModuleDetailscreateModuleDetailsFromPropertiesStream(java.io.InputStream is)Factory method to create module details from a stream of a properties filestatic ModuleDetailscreateModuleDetailsFromPropertiesStream(java.io.InputStream is, LogOutput log)Factory method to create module details from a stream of a properties filestatic ModuleDetailscreateModuleDetailsFromPropertyLocation(java.lang.String location)Creates a module details helper object based on a file location.static ModuleDetailscreateModuleDetailsFromPropertyLocation(java.lang.String location, LogOutput log)Creates a module details helper object based on a file location.static ModuleDetailscreateModuleDetailsFromWarAndId(java.lang.String warLocation, java.lang.String moduleId)Creates a module details instance based on a war location and the module idstatic de.schlichtherle.truezip.file.TFilegetModuleDetailsFileFromWarAndId(java.lang.String warLocation, java.lang.String moduleId)static java.lang.StringgetModulePropertiesFileLocation(java.lang.String warLocation, java.lang.String moduleId)Gets the file locationstatic java.lang.StringgetModulePropertiesFilePathInWar(java.lang.String moduleId)static voidsaveModuleDetails(java.lang.String warLocation, ModuleDetails moduleDetails)Saves the module details to the war in the correct location based on the module id
-
-
-
Method Detail
-
createModuleDetailsFromPropertiesStream
public static ModuleDetails createModuleDetailsFromPropertiesStream(java.io.InputStream is) throws java.io.IOException
Factory method to create module details from a stream of a properties file- Parameters:
is- the properties input stream, which will be closed during the call- Returns:
- Returns the initialized module details
- Throws:
java.io.IOException
-
createModuleDetailsFromPropertiesStream
public static ModuleDetails createModuleDetailsFromPropertiesStream(java.io.InputStream is, LogOutput log) throws java.io.IOException
Factory method to create module details from a stream of a properties file- Parameters:
is- the properties input stream, which will be closed during the calllog- logger- Returns:
- Returns the initialized module details
- Throws:
java.io.IOException
-
createModuleDetailsFromPropertyLocation
public static ModuleDetails createModuleDetailsFromPropertyLocation(java.lang.String location) throws java.io.IOException
Creates a module details helper object based on a file location.- Parameters:
location- file location- Returns:
- Returns the module details or null if the location points to nothing
- Throws:
java.io.IOException
-
createModuleDetailsFromPropertyLocation
public static ModuleDetails createModuleDetailsFromPropertyLocation(java.lang.String location, LogOutput log) throws java.io.IOException
Creates a module details helper object based on a file location.- Parameters:
location- file locationlog- logger- Returns:
- Returns the module details or null if the location points to nothing
- Throws:
java.io.IOException
-
createModuleDetailsFromWarAndId
public static ModuleDetails createModuleDetailsFromWarAndId(java.lang.String warLocation, java.lang.String moduleId) throws java.io.IOException
Creates a module details instance based on a war location and the module id- Parameters:
warLocation- the war locationmoduleId- the module id- Returns:
- Returns the module details for the given module ID as it occurs in the WAR, or null if there are no module details available.
- Throws:
java.io.IOException
-
getModuleDetailsFileFromWarAndId
public static de.schlichtherle.truezip.file.TFile getModuleDetailsFileFromWarAndId(java.lang.String warLocation, java.lang.String moduleId)- Parameters:
warLocation- the location of the WAR filemoduleId- the module ID within the WAR- Returns:
- Returns a file handle to the module properties file within the given WAR. The file may or may not exist.
-
getModulePropertiesFileLocation
public static java.lang.String getModulePropertiesFileLocation(java.lang.String warLocation, java.lang.String moduleId)Gets the file location- Parameters:
warLocation- the war locationmoduleId- the module id- Returns:
- the file location
-
getModulePropertiesFilePathInWar
public static java.lang.String getModulePropertiesFilePathInWar(java.lang.String moduleId)
- Parameters:
moduleId- the module ID- Returns:
- Returns the path of the module file within a WAR
-
saveModuleDetails
public static void saveModuleDetails(java.lang.String warLocation, ModuleDetails moduleDetails)Saves the module details to the war in the correct location based on the module id- Parameters:
warLocation- the war locationmoduleDetails- the module id
-
-