Class FileHandler

    • Constructor Detail

      • FileHandler

        public FileHandler()
        Construct a new instance with no formatter and no output file.
      • FileHandler

        public FileHandler​(java.util.logging.Formatter formatter)
        Construct a new instance with the given formatter and no output file.
        Parameters:
        formatter - the formatter
      • FileHandler

        public FileHandler​(java.util.logging.Formatter formatter,
                           java.io.File file)
                    throws java.io.FileNotFoundException
        Construct a new instance with the given formatter and output file.
        Parameters:
        formatter - the formatter
        file - the file
        Throws:
        java.io.FileNotFoundException - if the file could not be found on open
      • FileHandler

        public FileHandler​(java.util.logging.Formatter formatter,
                           java.io.File file,
                           boolean append)
                    throws java.io.FileNotFoundException
        Construct a new instance with the given formatter, output file, and append setting.
        Parameters:
        formatter - the formatter
        file - the file
        append - true to append, false to overwrite
        Throws:
        java.io.FileNotFoundException - if the file could not be found on open
      • FileHandler

        public FileHandler​(java.io.File file)
                    throws java.io.FileNotFoundException
        Construct a new instance with the given output file.
        Parameters:
        file - the file
        Throws:
        java.io.FileNotFoundException - if the file could not be found on open
      • FileHandler

        public FileHandler​(java.io.File file,
                           boolean append)
                    throws java.io.FileNotFoundException
        Construct a new instance with the given output file and append setting.
        Parameters:
        file - the file
        append - true to append, false to overwrite
        Throws:
        java.io.FileNotFoundException - if the file could not be found on open
      • FileHandler

        public FileHandler​(java.lang.String fileName)
                    throws java.io.FileNotFoundException
        Construct a new instance with the given output file.
        Parameters:
        fileName - the file name
        Throws:
        java.io.FileNotFoundException - if the file could not be found on open
      • FileHandler

        public FileHandler​(java.lang.String fileName,
                           boolean append)
                    throws java.io.FileNotFoundException
        Construct a new instance with the given output file and append setting.
        Parameters:
        fileName - the file name
        append - true to append, false to overwrite
        Throws:
        java.io.FileNotFoundException - if the file could not be found on open
    • Method Detail

      • setAppend

        public void setAppend​(boolean append)
        Specify whether to append to the target file.
        Parameters:
        append - true to append, false to overwrite
      • setFile

        public void setFile​(java.io.File file)
                     throws java.io.FileNotFoundException
        Set the output file.
        Parameters:
        file - the file
        Throws:
        java.io.FileNotFoundException - if an error occurs opening the file
      • getFile

        public java.io.File getFile()
        Get the current output file.
        Returns:
        the file
      • setFileName

        public void setFileName​(java.lang.String fileName)
                         throws java.io.FileNotFoundException
        Set the output file by name.
        Parameters:
        fileName - the file name
        Throws:
        java.io.FileNotFoundException - if an error occurs opening the file