Class 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 and toFile are used to tell Cargo where to install the file in reference to the container's home location.
    • toDir and toFile can be used independently or together. If toDir is null and toFile is foo, the destination of the file will be ${cargo.home}/foo.
    • If toDir is foo and the toFile is null, the destination of the new file will be ${cargo.home}/foo/original file's name}.
    • If toDir is foo and toFile is bar, the destination of the new file will be ${cargo.home}/foo/bar.
    • Constructor Detail

      • FileConfig

        public FileConfig()
        Constructor.
    • 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 be null or empty to use the platform's default encoding.