Package org.jboss.modules
Class ModuleXmlUtil
- java.lang.Object
-
- org.jboss.modules.ModuleXmlUtil
-
class ModuleXmlUtil extends java.lang.Object
Utility class for default module file names. Date: 10.05.2011
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_FILENAME
-
Constructor Summary
Constructors Modifier Constructor Description private
ModuleXmlUtil()
Private constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
baseDirectory(ModuleIdentifier identifier)
Creates a path name from the module identifier with the defaultFile.separator
character.static java.lang.String
baseDirectory(ModuleIdentifier identifier, java.lang.String separator)
Creates a path name from the module identifier.static java.lang.String
baseFilename(java.lang.String name, java.lang.String separator, ModuleIdentifier identifier)
Creates a path name to the module XMLstatic java.lang.String
baseFilename(java.lang.String name, ModuleIdentifier identifier)
Creates a path name to the module XML file from the module identifier.static java.lang.String
baseFilename(ModuleIdentifier identifier)
Creates a path name to the module XML file from the module identifier.static java.io.File
toFile(java.io.File dir, java.lang.String name, ModuleIdentifier identifier)
Creates a file based on the directory and the module identifier.static java.io.File
toFile(java.io.File dir, ModuleIdentifier identifier)
Creates a file based on the directory and the module identifier.
-
-
-
Field Detail
-
DEFAULT_FILENAME
public static final java.lang.String DEFAULT_FILENAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
toFile
public static java.io.File toFile(java.io.File dir, ModuleIdentifier identifier)
Creates a file based on the directory and the module identifier. Thedir
parameter must be a directory and theidentifier
cannot benull
.- Parameters:
dir
- the base directory where the file should be located.identifier
- the module identifier.- Returns:
- the module XML file.
- Throws:
java.lang.IllegalArgumentException
- if thedir
parameter is not a directory or an argument isnull
.
-
toFile
public static java.io.File toFile(java.io.File dir, java.lang.String name, ModuleIdentifier identifier)
Creates a file based on the directory and the module identifier. Thedir
parameter must be a directory and theidentifier
cannot benull
.- 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:
java.lang.IllegalArgumentException
- if thedir
parameter is not a directory or an argument isnull
.
-
baseDirectory
public static java.lang.String baseDirectory(ModuleIdentifier identifier, java.lang.String separator)
Creates a path name from the module identifier. The name always ends with the separator character. Anull
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:
java.lang.IllegalArgumentException
- if the module identifier isnull
.
-
baseDirectory
public static java.lang.String baseDirectory(ModuleIdentifier identifier)
Creates a path name from the module identifier with the defaultFile.separator
character.- Parameters:
identifier
- the module identifier.- Returns:
- a path name of the module identifier.
- Throws:
java.lang.IllegalArgumentException
- if the module identifier isnull
.- See Also:
baseDirectory(ModuleIdentifier, String)
-
baseFilename
public static java.lang.String baseFilename(ModuleIdentifier identifier)
Creates a path name to the module XML file from the module identifier. Uses theDEFAULT_FILENAME
for the XML file name.- Parameters:
identifier
- the module identifier.- Returns:
- a path name to the module XML file.
- Throws:
java.lang.IllegalArgumentException
- if the module identifier isnull
.
-
baseFilename
public static java.lang.String baseFilename(java.lang.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:
java.lang.IllegalArgumentException
- if the module identifier isnull
.
-
baseFilename
public static java.lang.String baseFilename(java.lang.String name, java.lang.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:
java.lang.IllegalArgumentException
- if the module identifier isnull
.
-
-