Package globus.glmap

Class GLMapFileStorage.FileInfo

java.lang.Object
globus.glmap.GLMapStorageFile
globus.glmap.GLMapFileStorage.FileInfo
Enclosing class:
GLMapFileStorage

public static class GLMapFileStorage.FileInfo extends GLMapStorageFile
The FileInfo class represents a file in the GLMapFileStorage.
  • Field Details

    • file

      @NonNull public File file
      The file represented by this FileInfo.
  • Method Details

    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • getStorage

      @NonNull public GLMapFileStorage getStorage()
      Description copied from class: GLMapStorageFile
      Returns the storage that contains this file.
      Specified by:
      getStorage in class GLMapStorageFile
      Returns:
      the storage containing this file
    • isDirectory

      public boolean isDirectory()
      Description copied from class: GLMapStorageFile
      Returns true if this object is a directory
      Specified by:
      isDirectory in class GLMapStorageFile
      Returns:
      true if this object is a directory
    • getAsStorage

      @Nullable public GLMapStorage getAsStorage()
      Description copied from class: GLMapStorageFile
      Returns this file as a storage
      Specified by:
      getAsStorage in class GLMapStorageFile
      Returns:
      storage if this object is a directory, otherwise null
    • getName

      @Nullable public String getName()
      Description copied from class: GLMapStorageFile
      Gets the name of this file.
      Specified by:
      getName in class GLMapStorageFile
      Returns:
      the name of the file, or null if it has no name
    • setName

      public boolean setName(String newName)
      Description copied from class: GLMapStorageFile
      Sets the name of this file.
      Specified by:
      setName in class GLMapStorageFile
      Parameters:
      newName - the new name to set
      Returns:
      true if the name was successfully set, false otherwise
    • getVFSName

      @Nullable public String getVFSName()
      Description copied from class: GLMapStorageFile
      Gets the VFS (Virtual File System) name of this file.
      Specified by:
      getVFSName in class GLMapStorageFile
      Returns:
      the VFS name of the file, or null if it has no VFS name
    • openInputStream

      public InputStream openInputStream() throws FileNotFoundException
      Description copied from class: GLMapStorageFile
      Opens an input stream to read from this file.
      Specified by:
      openInputStream in class GLMapStorageFile
      Returns:
      an input stream to read from the file
      Throws:
      FileNotFoundException - if the file cannot be found
    • openOutputStream

      public OutputStream openOutputStream() throws FileNotFoundException
      Description copied from class: GLMapStorageFile
      Opens an output stream to write to this file.
      Specified by:
      openOutputStream in class GLMapStorageFile
      Returns:
      an output stream to write to the file
      Throws:
      FileNotFoundException - if the file cannot be found
    • openForReading

      public int openForReading()
      Description copied from class: GLMapStorageFile
      Opens the file for reading.
      Specified by:
      openForReading in class GLMapStorageFile
      Returns:
      a file descriptor for reading from the file
    • openForWriting

      public int openForWriting(boolean truncate)
      Description copied from class: GLMapStorageFile
      Opens the file for writing.
      Specified by:
      openForWriting in class GLMapStorageFile
      Parameters:
      truncate - if true, truncates the file to zero length before writing
      Returns:
      a file descriptor for writing to the file
    • delete

      public boolean delete()
      Description copied from class: GLMapStorageFile
      Deletes this file.
      Specified by:
      delete in class GLMapStorageFile
      Returns:
      true if the file was successfully deleted, false otherwise
    • truncate

      public boolean truncate()
      Description copied from class: GLMapStorageFile
      Truncates the file to zero length.
      Overrides:
      truncate in class GLMapStorageFile
      Returns:
      true if the file was successfully truncated, false otherwise
    • getLength

      public long getLength()
      Description copied from class: GLMapStorageFile
      Returns the size of the file in bytes.
      Specified by:
      getLength in class GLMapStorageFile
      Returns:
      the size of the file in bytes
    • getLastModified

      public long getLastModified()
      Description copied from class: GLMapStorageFile
      Returns the last modified timestamp of the file.
      Specified by:
      getLastModified in class GLMapStorageFile
      Returns:
      the last modified timestamp of the file
    • setLastModified

      public boolean setLastModified(long lastModified)
      Description copied from class: GLMapStorageFile
      Sets the last modified timestamp of the file.
      Specified by:
      setLastModified in class GLMapStorageFile
      Parameters:
      lastModified - the new last modified timestamp
      Returns:
      true if the timestamp was successfully set, false otherwise