Class ModuleDetailsHelper

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

public class ModuleDetailsHelper extends Object
Module details helper used by the module mangement tool
Author:
Roy Wetherall, Derek Hulley
  • Constructor Details

    • ModuleDetailsHelper

      public ModuleDetailsHelper()
  • Method Details

    • createModuleDetailsFromPropertiesStream

      public static ModuleDetails createModuleDetailsFromPropertiesStream(InputStream is) throws 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:
      IOException
    • createModuleDetailsFromPropertiesStream

      public static ModuleDetails createModuleDetailsFromPropertiesStream(InputStream is, LogOutput log) throws 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
      log - logger
      Returns:
      Returns the initialized module details
      Throws:
      IOException
    • createModuleDetailsFromPropertyLocation

      public static ModuleDetails createModuleDetailsFromPropertyLocation(String location) throws 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:
      IOException
    • createModuleDetailsFromPropertyLocation

      public static ModuleDetails createModuleDetailsFromPropertyLocation(String location, LogOutput log) throws IOException
      Creates a module details helper object based on a file location.
      Parameters:
      location - file location
      log - logger
      Returns:
      Returns the module details or null if the location points to nothing
      Throws:
      IOException
    • createModuleDetailsFromWarAndId

      public static ModuleDetails createModuleDetailsFromWarAndId(String warLocation, String moduleId) throws IOException
      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.
      Throws:
      IOException
    • getModuleDetailsFileFromWarAndId

      public static de.schlichtherle.truezip.file.TFile getModuleDetailsFileFromWarAndId(String warLocation, 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 String getModulePropertiesFileLocation(String warLocation, String moduleId)
      Gets the file location
      Parameters:
      warLocation - the war location
      moduleId - the module id
      Returns:
      the file location
    • getModulePropertiesFilePathInWar

      public static String getModulePropertiesFilePathInWar(String moduleId)
      Parameters:
      moduleId - the module ID
      Returns:
      Returns the path of the module file within a WAR
    • saveModuleDetails

      public static void saveModuleDetails(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
      moduleDetails - the module id