org.alfresco.repo.module.tool
Class ModuleDetailsHelper

java.lang.Object
  extended by org.alfresco.repo.module.tool.ModuleDetailsHelper

public class ModuleDetailsHelper
extends java.lang.Object

Module details helper used by the module mangement tool


Constructor Summary
ModuleDetailsHelper()
           
 
Method Summary
static ModuleDetails createModuleDetailsFromPropertiesStream(java.io.InputStream is)
          Factory method to create module details from a stream of a properties file
static ModuleDetails createModuleDetailsFromPropertyLocation(java.lang.String location)
          Creates a module details helper object based on a file location.
static ModuleDetails createModuleDetailsFromWarAndId(java.lang.String warLocation, java.lang.String moduleId)
          Creates a module details instance based on a war location and the module id
static de.schlichtherle.io.File getModuleDetailsFileFromWarAndId(java.lang.String warLocation, java.lang.String moduleId)
           
static java.lang.String getModulePropertiesFileLocation(java.lang.String warLocation, java.lang.String moduleId)
          Gets the file location
static java.lang.String getModulePropertiesFilePathInWar(java.lang.String moduleId)
           
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleDetailsHelper

public ModuleDetailsHelper()
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

createModuleDetailsFromPropertyLocation

public static ModuleDetails createModuleDetailsFromPropertyLocation(java.lang.String location)
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

createModuleDetailsFromWarAndId

public static ModuleDetails createModuleDetailsFromWarAndId(java.lang.String warLocation,
                                                            java.lang.String moduleId)
Creates a module details instance based on a war location and the module id

Parameters:
warLocation - the war location
moduleId - 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.

getModuleDetailsFileFromWarAndId

public static de.schlichtherle.io.File getModuleDetailsFileFromWarAndId(java.lang.String warLocation,
                                                                        java.lang.String moduleId)
Parameters:
warLocation - the location of the WAR file
moduleId - 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 location
moduleId - 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 location
moduleId - the module id


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.