Package com.ibm.dbb.build
Class ScriptMappings
- java.lang.Object
-
- com.ibm.dbb.build.ScriptMappings
-
public class ScriptMappings extends java.lang.Object
The ScriptMappings class is a convenient 'wrapper' class forBuildProperties
that provides utility methods to work specifically with script mappings.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DBB_SCRIPT_MAPPING_KEY
Script mapping BuildProperties key (added in DBB 1.0.2)static java.lang.String
SCRIPT_MAPPING_KEY
Deprecated.- UseDBB_SCRIPT_MAPPING_KEY
-
Constructor Summary
Constructors Constructor Description ScriptMappings()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addFilePattern(java.lang.String scriptName, java.lang.String filePattern)
Appends a file pattern to the list of associated file patterns for the script mappingstatic void
addFilePatterns(java.lang.String scriptName, java.util.List<java.lang.String> filePatterns)
Appends a list of file patterns to the list of associated file patterns for the script mappingstatic java.util.List<java.lang.String>
getMappedList(java.lang.String scriptName, java.io.File file)
Returns a sublist of files that are mapped the the script namestatic java.util.List<java.lang.String>
getMappedList(java.lang.String scriptName, java.io.File file, java.lang.String encoding)
Returns a sublist of files that are mapped the the script namestatic java.util.List<java.lang.String>
getMappedList(java.lang.String scriptName, java.util.List<java.lang.String> files)
Returns a sublist of files that are mapped the the script namestatic java.lang.String
getScriptName(java.lang.String file)
Returns the script name associated to the relative path file orNULL
if no script name is found for the file.static java.util.Set<java.lang.String>
getScriptNames()
Returns all the script mappings namesstatic boolean
isMapped(java.lang.String scriptName, java.lang.String file)
Returnstrue
if the list contains the script mappingstatic void
setScriptName(java.lang.String scriptName, java.util.List<java.lang.String> filePatterns)
Sets a script mapping association.
-
-
-
Field Detail
-
SCRIPT_MAPPING_KEY
public static final java.lang.String SCRIPT_MAPPING_KEY
Deprecated.- UseDBB_SCRIPT_MAPPING_KEY
Script mapping BuildProperties key- See Also:
- Constant Field Values
-
DBB_SCRIPT_MAPPING_KEY
public static final java.lang.String DBB_SCRIPT_MAPPING_KEY
Script mapping BuildProperties key (added in DBB 1.0.2)- See Also:
- Constant Field Values
-
-
Method Detail
-
getScriptName
public static java.lang.String getScriptName(java.lang.String file)
Returns the script name associated to the relative path file orNULL
if no script name is found for the file.- Parameters:
file
- The relative path of the file to search for.- Returns:
- The name of the script associated to the file or
NULL
if none found
-
setScriptName
public static void setScriptName(java.lang.String scriptName, java.util.List<java.lang.String> filePatterns)
Sets a script mapping association. If the script mapping already exists, the existing file pattern associations are replaced with the new file patterns- Parameters:
scriptName
- The name of the script to associatefilePatterns
- The list of file patterns to associate to this script
-
addFilePattern
public static void addFilePattern(java.lang.String scriptName, java.lang.String filePattern)
Appends a file pattern to the list of associated file patterns for the script mapping- Parameters:
scriptName
- The name of the scriptfilePattern
- The file pattern to add to the script mapping
-
addFilePatterns
public static void addFilePatterns(java.lang.String scriptName, java.util.List<java.lang.String> filePatterns)
Appends a list of file patterns to the list of associated file patterns for the script mapping- Parameters:
scriptName
- The name of the scriptfilePatterns
- The list of file patterns to add to the script mapping
-
isMapped
public static boolean isMapped(java.lang.String scriptName, java.lang.String file)
Returnstrue
if the list contains the script mapping- Parameters:
scriptName
- The name of the scriptfile
- The relative file associated to the script name- Returns:
true
if the list contains the script mapping
-
getMappedList
public static java.util.List<java.lang.String> getMappedList(java.lang.String scriptName, java.util.List<java.lang.String> files)
Returns a sublist of files that are mapped the the script name- Parameters:
scriptName
- The name of the script be matchedfiles
- The list of files to match- Returns:
- A list of relative path files that are associated to the script name
-
getMappedList
public static java.util.List<java.lang.String> getMappedList(java.lang.String scriptName, java.io.File file) throws java.io.IOException
Returns a sublist of files that are mapped the the script name- Parameters:
scriptName
- The name of the script be matchedfile
- An external file containing a list of files to match- Returns:
- A list of relative path files that are associated to the script name
- Throws:
java.io.IOException
- If an error occurred when reading the file.
-
getMappedList
public static java.util.List<java.lang.String> getMappedList(java.lang.String scriptName, java.io.File file, java.lang.String encoding) throws java.io.IOException
Returns a sublist of files that are mapped the the script name- Parameters:
scriptName
- The name of the script be matchedfile
- An external file containing a list of files to matchencoding
- The encoding of the input file- Returns:
- A list of relative path files that are associated to the script name
- Throws:
java.io.IOException
- If an error occurred when reading the file.
-
getScriptNames
public static java.util.Set<java.lang.String> getScriptNames()
Returns all the script mappings names- Returns:
- A set of all script mapping names
-
-