Class RollingFile

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<java.io.File>
    Direct Known Subclasses:
    RollingDateFile

    public class RollingFile
    extends java.io.File
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.io.File

        pathSeparator, pathSeparatorChar, separator, separatorChar
    • Constructor Summary

      Constructors 
      Constructor Description
      RollingFile​(java.lang.String pathname, java.lang.String baseName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int calcPos()  
      protected java.lang.String getFileExpression()  
      java.io.File getNewFile()  
      protected java.lang.String getNewFileName()  
      java.io.File[] readAll()
      read all matching files from this
      void setDigits​(int digits)  
      • Methods inherited from class java.io.File

        canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RollingFile

        public RollingFile​(java.lang.String pathname,
                           java.lang.String baseName)
        Parameters:
        pathname - the base filename
        baseName - the name of the base file,
        if a filename with double "." , e.g. xxx..txt is specified, the algorithm will generate names such as xxx.000001.txt,
        if a single "." e.g. xxx.txt is specified, the algorithm will generate names such as xxx000001.txt,
    • Method Detail

      • calcPos

        protected int calcPos()
        Returns:
      • readAll

        public java.io.File[] readAll()
        read all matching files from this
        Returns:
        array of all matching files
      • getFileExpression

        protected java.lang.String getFileExpression()
        Returns:
      • getNewFile

        public java.io.File getNewFile()
        Returns:
        the file to write, null if error occurred
      • getNewFileName

        protected java.lang.String getNewFileName()
        Returns:
        the file to write, i.e. this
      • setDigits

        public void setDigits​(int digits)
        Parameters:
        digits - the digits to set