public class ScriptMappings
extends java.lang.Object
BuildProperties
that provides utility methods to
work specifically with script mappings.Modifier and Type | Field and 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.
- Use
DBB_SCRIPT_MAPPING_KEY |
Constructor and Description |
---|
ScriptMappings() |
Modifier and Type | Method and 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 mapping
|
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
|
static 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 name
|
static 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 name
|
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
|
static java.lang.String |
getScriptName(java.lang.String file)
Returns the script name associated to the relative path file or
NULL if no script name is
found for the file. |
static java.util.Set<java.lang.String> |
getScriptNames()
Returns all the script mappings names
|
static boolean |
isMapped(java.lang.String scriptName,
java.lang.String file)
Returns
true if the list contains the script mapping |
static void |
setScriptName(java.lang.String scriptName,
java.util.List<java.lang.String> filePatterns)
Sets a script mapping association.
|
public static final java.lang.String SCRIPT_MAPPING_KEY
DBB_SCRIPT_MAPPING_KEY
public static final java.lang.String DBB_SCRIPT_MAPPING_KEY
public static java.lang.String getScriptName(java.lang.String file)
NULL
if no script name is
found for the file.file
- The relative path of the file to search for.NULL
if none foundpublic static void setScriptName(java.lang.String scriptName, java.util.List<java.lang.String> filePatterns)
scriptName
- The name of the script to associatefilePatterns
- The list of file patterns to associate to this scriptpublic static void addFilePattern(java.lang.String scriptName, java.lang.String filePattern)
scriptName
- The name of the scriptfilePattern
- The file pattern to add to the script mappingpublic static void addFilePatterns(java.lang.String scriptName, java.util.List<java.lang.String> filePatterns)
scriptName
- The name of the scriptfilePatterns
- The list of file patterns to add to the script mappingpublic static boolean isMapped(java.lang.String scriptName, java.lang.String file)
true
if the list contains the script mappingscriptName
- The name of the scriptfile
- The relative file associated to the script nametrue
if the list contains the script mappingpublic static java.util.List<java.lang.String> getMappedList(java.lang.String scriptName, java.util.List<java.lang.String> files)
scriptName
- The name of the script be matchedfiles
- The list of files to matchpublic static java.util.List<java.lang.String> getMappedList(java.lang.String scriptName, java.io.File file) throws java.io.IOException
scriptName
- The name of the script be matchedfile
- An external file containing a list of files to matchjava.io.IOException
- If an error occurred when reading the file.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
scriptName
- The name of the script be matchedfile
- An external file containing a list of files to matchencoding
- The encoding of the input filejava.io.IOException
- If an error occurred when reading the file.public static java.util.Set<java.lang.String> getScriptNames()
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.