Package hec.io

Class SimpleFileOpenerImpl

java.lang.Object
hec.io.SimpleFileOpenerImpl
All Implemented Interfaces:
FileOpener

public class SimpleFileOpenerImpl extends Object implements FileOpener
  • Constructor Details

    • SimpleFileOpenerImpl

      public SimpleFileOpenerImpl()
  • Method Details

    • openFile

      public Identifier openFile(Identifier fileToOpenId, boolean useCache)
      Description copied from interface: FileOpener
      Opens the file specified by fileToOpenId.
      Specified by:
      openFile in interface FileOpener
      Parameters:
      fileToOpenId - the file to open
      useCache - true if the file should be downloaded to the cache directory and then read
      Returns:
      An Identifier with a hec.io.HecFile attached or null if the file doesn't exist
    • createFile

      public Identifier createFile(Identifier fileToCreateId)
      Description copied from interface: FileOpener
      Creates the file specified by fileToCreateId. If the file exists it is not opened.
      Specified by:
      createFile in interface FileOpener
      Parameters:
      fileToCreateId - the file to open
      Returns:
      An Identifier with a hec.io.HecFile attached or null if the file exists
    • lockFile

      public boolean lockFile(Identifier id, FileLock flock)
      Specified by:
      lockFile in interface FileOpener
      Returns:
    • unlockFile

      public boolean unlockFile(Identifier id, FileLock flock)
      Specified by:
      unlockFile in interface FileOpener
      Returns:
    • getFileList

      public List getFileList(String path, String filter)
      Description copied from interface: FileOpener
      Return a List of files in the directory path that matches the filter filter.
      Specified by:
      getFileList in interface FileOpener
      Parameters:
      path - the directory to get the List of files from
      filter - the file name filter
      Returns:
      A List of files in the directory path that match filter
    • getDriveList

      public List getDriveList()
      Description copied from interface: FileOpener
      return a List of drives on the machine
      Specified by:
      getDriveList in interface FileOpener