mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Support for renaming of modules
- When a module ID changes, the old ID gets put in a list against property 'module.aliases'. - The tool and the repo startup detect the existing installation against the alias and perform a rename. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5559 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -75,7 +75,7 @@ public class ModuleDetailsHelper
|
||||
try
|
||||
{
|
||||
File file = new File(location, ModuleManagementTool.DETECTOR_AMP_AND_WAR);
|
||||
if (file.exists() == true)
|
||||
if (file.exists())
|
||||
{
|
||||
InputStream is = new FileInputStream(file);
|
||||
result = createModuleDetailsFromPropertiesStream(is);
|
||||
@@ -102,6 +102,19 @@ public class ModuleDetailsHelper
|
||||
return ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(modulePropertiesFileLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param warLocation the location of the WAR file
|
||||
* @param moduleId the module ID within the WAR
|
||||
* @return Returns a file handle to the module properties file within the given WAR.
|
||||
* The file may or may not exist.
|
||||
*/
|
||||
public static File getModuleDetailsFileFromWarAndId(String warLocation, String moduleId)
|
||||
{
|
||||
String location = ModuleDetailsHelper.getModulePropertiesFileLocation(warLocation, moduleId);
|
||||
File file = new File(location, ModuleManagementTool.DETECTOR_AMP_AND_WAR);
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file location
|
||||
*
|
||||
@@ -109,9 +122,18 @@ public class ModuleDetailsHelper
|
||||
* @param moduleId the module id
|
||||
* @return the file location
|
||||
*/
|
||||
private static String getModulePropertiesFileLocation(String warLocation, String moduleId)
|
||||
public static String getModulePropertiesFileLocation(String warLocation, String moduleId)
|
||||
{
|
||||
return warLocation + ModuleManagementTool.MODULE_DIR + "/" + moduleId + "/" + "module.properties";
|
||||
return warLocation + getModulePropertiesFilePathInWar(moduleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param moduleId the module ID
|
||||
* @return Returns the path of the module file within a WAR
|
||||
*/
|
||||
public static String getModulePropertiesFilePathInWar(String moduleId)
|
||||
{
|
||||
return ModuleManagementTool.MODULE_DIR + "/" + moduleId + "/" + "module.properties";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user