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
toDir
andtoFile
are used to tell Cargo where to install the file in reference to the container'shome
location. toDir
andtoFile
can be used independently or together. IftoDir
isnull
andtoFile
isfoo
, the destination of the file will be${cargo.home}/foo
.- If
toDir
isfoo
and thetoFile
isnull
, the destination of the new file will be${cargo.home}/foo/original file's name}
. - If
toDir
isfoo
andtoFile
isbar
, 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 boolean
getConfigfile()
Returns true if the file is marked as a configuration fileString
getEncoding()
Gets the character encoding to use when token filtering is performed.Charset
getEncodingAsCharset()
Gets the character encoding to use when token filtering is performed, as a Charset.String
getFile()
Returns the name of the file to be used.boolean
getOverwrite()
Return true if the file should overwrite an existing file.String
getToDir()
Returns the name of the destination directory.String
getToFile()
Returns the name of the destination file.void
setConfigfile(boolean configfile)
Set if the destination should be considered a configuration filevoid
setConfigfile(String configfile)
Set if the destination should be considered a configuration filevoid
setEncoding(String encoding)
Sets the character encoding to use when token filtering is performed.void
setFile(String file)
Sets the file to be used.void
setOverwrite(boolean overwrite)
Set if the destination file should be overwritten.void
setOverwrite(String overwrite)
Set if the destination file should be overwritten.void
setToDir(String todir)
Sets the destination directory to use.void
setToFile(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 benull
or empty to use the platform's default encoding.
-
-