Class FileConfig
- java.lang.Object
-
- org.codehaus.cargo.container.configuration.FileConfig
-
public class FileConfig extends Object
Contains data about configuration files that should be used for the container. This option only works with standalone local containers.- The
toDirandtoFileare used to tell Cargo where to install the file in reference to the container'shomelocation. toDirandtoFilecan be used independently or together. IftoDirisnullandtoFileisfoo, the destination of the file will be${cargo.home}/foo.- If
toDirisfooand thetoFileisnull, the destination of the new file will be${cargo.home}/foo/original file's name}. - If
toDirisfooandtoFileisbar, the destination of the new file will be${cargo.home}/foo/bar.
- The
-
-
Constructor Summary
Constructors Constructor Description FileConfig()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetConfigfile()Returns true if the file is marked as a configuration fileStringgetEncoding()Gets the character encoding to use when token filtering is performed.CharsetgetEncodingAsCharset()Gets the character encoding to use when token filtering is performed, as a Charset.StringgetFile()Returns the name of the file to be used.booleangetOverwrite()Return true if the file should overwrite an existing file.StringgetToDir()Returns the name of the destination directory.StringgetToFile()Returns the name of the destination file.voidsetConfigfile(boolean configfile)Set if the destination should be considered a configuration filevoidsetConfigfile(String configfile)Set if the destination should be considered a configuration filevoidsetEncoding(String encoding)Sets the character encoding to use when token filtering is performed.voidsetFile(String file)Sets the file to be used.voidsetOverwrite(boolean overwrite)Set if the destination file should be overwritten.voidsetOverwrite(String overwrite)Set if the destination file should be overwritten.voidsetToDir(String todir)Sets the destination directory to use.voidsetToFile(String tofile)Sets the destination file name.
-
-
-
Method Detail
-
getFile
public String getFile()
Returns the name of the file to be used.- Returns:
- The file to be used
-
getToFile
public String getToFile()
Returns the name of the destination file.- Returns:
- The name of the destination file
-
getToDir
public String getToDir()
Returns the name of the destination directory.- Returns:
- The destination directory
-
getOverwrite
public boolean getOverwrite()
Return true if the file should overwrite an existing file.- Returns:
- if the file should be overwritten
-
getConfigfile
public boolean getConfigfile()
Returns true if the file is marked as a configuration file- Returns:
- If the file is a config file or not
-
setFile
public void setFile(String file)
Sets the file to be used.- Parameters:
file- The file to use
-
setToFile
public void setToFile(String tofile)
Sets the destination file name.- Parameters:
tofile- The destination file name
-
setToDir
public void setToDir(String todir)
Sets the destination directory to use.- Parameters:
todir- The destination directory
-
setOverwrite
public void setOverwrite(String overwrite)
Set if the destination file should be overwritten.- Parameters:
overwrite- Set to true if files should overwrite
-
setOverwrite
public void setOverwrite(boolean overwrite)
Set if the destination file should be overwritten.- Parameters:
overwrite- Set to true if files should overwrite
-
setConfigfile
public void setConfigfile(String configfile)
Set if the destination should be considered a configuration file- Parameters:
configfile- Set to true if file is a configfile
-
setConfigfile
public void setConfigfile(boolean configfile)
Set if the destination should be considered a configuration file- Parameters:
configfile- Set to true if file is a configfile
-
getEncoding
public String getEncoding()
Gets the character encoding to use when token filtering is performed.- Returns:
- The character encoding to use when token filtering is performed or
null/empty if the platform's default encoding should be used.
-
getEncodingAsCharset
public Charset getEncodingAsCharset()
Gets the character encoding to use when token filtering is performed, as a Charset.- Returns:
- The character encoding to use when token filtering is performed or
null/empty if the platform's default encoding should be used.
-
setEncoding
public void setEncoding(String encoding)
Sets the character encoding to use when token filtering is performed.- Parameters:
encoding- The character encoding to use when token filtering is performed, may benullor empty to use the platform's default encoding.
-
-