Class ModuleXmlUtil

java.lang.Object
org.jboss.modules.ModuleXmlUtil

class ModuleXmlUtil extends Object
Utility class for default module file names.

Date: 10.05.2011

  • Field Details

  • Constructor Details

    • ModuleXmlUtil

      private ModuleXmlUtil()
      Private constructor.
  • Method Details

    • toFile

      public static File toFile(File dir, ModuleIdentifier identifier)
      Creates a file based on the directory and the module identifier.

      The dir parameter must be a directory and the identifier cannot be null.

      Parameters:
      dir - the base directory where the file should be located.
      identifier - the module identifier.
      Returns:
      the module XML file.
      Throws:
      IllegalArgumentException - if the dir parameter is not a directory or an argument is null.
    • toFile

      public static File toFile(File dir, String name, ModuleIdentifier identifier)
      Creates a file based on the directory and the module identifier.

      The dir parameter must be a directory and the identifier cannot be null.

      Parameters:
      dir - the base directory where the file should be located.
      name - the name of the XML file.
      identifier - the module identifier.
      Returns:
      the module XML file.
      Throws:
      IllegalArgumentException - if the dir parameter is not a directory or an argument is null.
    • baseDirectory

      public static String baseDirectory(ModuleIdentifier identifier, String separator)
      Creates a path name from the module identifier. The name always ends with the separator character.

      A null identifier will result in no separator being used.
      Parameters:
      identifier - the module identifier.
      separator - the directory separator.
      Returns:
      a path name of the module identifier.
      Throws:
      IllegalArgumentException - if the module identifier is null.
    • baseDirectory

      public static String baseDirectory(ModuleIdentifier identifier)
      Creates a path name from the module identifier with the default File.separator character.
      Parameters:
      identifier - the module identifier.
      Returns:
      a path name of the module identifier.
      Throws:
      IllegalArgumentException - if the module identifier is null.
      See Also:
    • baseFilename

      public static String baseFilename(ModuleIdentifier identifier)
      Creates a path name to the module XML file from the module identifier. Uses the DEFAULT_FILENAME for the XML file name.
      Parameters:
      identifier - the module identifier.
      Returns:
      a path name to the module XML file.
      Throws:
      IllegalArgumentException - if the module identifier is null.
    • baseFilename

      public static String baseFilename(String name, ModuleIdentifier identifier)
      Creates a path name to the module XML file from the module identifier.
      Parameters:
      name - the XML file name.
      identifier - the module identifier.
      Returns:
      a path name to the module XML file.
      Throws:
      IllegalArgumentException - if the module identifier is null.
    • baseFilename

      public static String baseFilename(String name, String separator, ModuleIdentifier identifier)
      Creates a path name to the module XML
      Parameters:
      name - the XML file name. file from the module identifier.
      separator - the directory separator.
      identifier - the module identifier.
      Returns:
      a path name to the module XML file.
      Throws:
      IllegalArgumentException - if the module identifier is null.