Class GenericFile

java.lang.Object
ecmwf.common.technical.GenericFile
Direct Known Subclasses:
GenericFileChecker, RegularFile

public abstract class GenericFile extends Object
The Class GenericFile.
  • Constructor Details

    • GenericFile

      public GenericFile()
  • Method Details

    • getGenericFile

      public static GenericFile getGenericFile(GenericFile parent, String child)
      Gets the generic file.
      Parameters:
      parent - the parent
      child - the child
      Returns:
      the generic file
    • getGenericFile

      public static GenericFile getGenericFile(String parent, String child)
      Gets the generic file.
      Parameters:
      parent - the parent
      child - the child
      Returns:
      the generic file
    • getGenericFile

      public static GenericFile getGenericFile(String path)
      Gets the generic file.
      Parameters:
      path - the path
      Returns:
      the generic file
    • exists

      public abstract boolean exists() throws IOException
      Exists.
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getPath

      public abstract String getPath()
      Gets the path.
      Returns:
      the path
    • getAbsolutePath

      public abstract String getAbsolutePath()
      Gets the absolute path.
      Returns:
      the absolute path
    • getParent

      public abstract String getParent()
      Gets the parent.
      Returns:
      the parent
    • getName

      public abstract String getName()
      Gets the name.
      Returns:
      the name
    • renameTo

      public abstract boolean renameTo(String path) throws IOException
      Rename to.
      Parameters:
      path - the path
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getFile

      public abstract File getFile() throws IOException
      Gets the file.
      Returns:
      the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getParentFile

      public abstract GenericFile getParentFile()
      Gets the parent file.
      Returns:
      the parent file
    • delete

      public abstract boolean delete() throws IOException
      Delete.
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • delete

      public boolean delete(boolean recursive) throws IOException
      Delete.
      Parameters:
      recursive - the recursive
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • mkdir

      public abstract boolean mkdir() throws IOException
      Mkdir.
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • mkdirs

      public abstract boolean mkdirs() throws IOException
      Mkdirs.
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • canRead

      public abstract boolean canRead()
      Can read.
      Returns:
      true, if successful
    • canWrite

      public abstract boolean canWrite()
      Can write.
      Returns:
      true, if successful
    • isAbsolute

      public abstract boolean isAbsolute() throws IOException
      Checks if is absolute.
      Returns:
      true, if is absolute
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • lastModified

      public abstract long lastModified() throws IOException
      Last modified.
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • setLastModified

      public abstract boolean setLastModified(long time) throws IOException
      Sets the last modified.
      Parameters:
      time - the time
      Returns:
      true, if successful
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • setReadOnly

      public abstract boolean setReadOnly()
      Sets the read only.
      Returns:
      true, if successful
    • isDirectory

      public abstract boolean isDirectory() throws IOException
      Checks if is directory.
      Returns:
      true, if is directory
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • isFile

      public abstract boolean isFile() throws IOException
      Checks if is file.
      Returns:
      true, if is file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • length

      public abstract long length() throws IOException
      Length.
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • list

      public abstract String[] list(GenericFileFilter filter) throws IOException
      List.
      Parameters:
      filter - the filter
      Returns:
      the string[]
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • list

      public abstract String[] list() throws IOException
      List.
      Returns:
      the string[]
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listCount

      public abstract long listCount() throws IOException
      Gives the number of files included in the specified directory and sub-directories.
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listSize

      public abstract long listSize() throws IOException
      Gives the total size of the files included in the specified directory and sub-directories.
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listFiles

      public abstract GenericFile[] listFiles(GenericFileFilter filter) throws IOException
      List files.
      Parameters:
      filter - the filter
      Returns:
      the generic file[]
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listFiles

      public abstract GenericFile[] listFiles() throws IOException
      List files.
      Returns:
      the generic file[]
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getInputStream

      public abstract InputStream getInputStream() throws IOException
      Gets the input stream.
      Returns:
      the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getOutputStream

      public abstract OutputStream getOutputStream() throws IOException
      Gets the output stream.
      Returns:
      the output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getOutputStream

      public abstract OutputStream getOutputStream(boolean append) throws IOException
      Gets the output stream.
      Parameters:
      append - the append
      Returns:
      the output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • transmitFile

      public abstract long transmitFile(OutputStream out, long offset) throws IOException
      Transmit file.
      Parameters:
      out - the out
      offset - the offset
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • receiveFile

      public abstract long receiveFile(InputStream in, long size) throws IOException
      Receive file.
      Parameters:
      in - the in
      size - the size
      Returns:
      the long
      Throws:
      IOException - Signals that an I/O exception has occurred.