Class TemporaryFile

java.lang.Object
velox.api.layer1.common.temporaryfiles.TemporaryFile

@Deprecated public class TemporaryFile extends Object
Deprecated.
Use TempPath instead.
Manages files and folders inside temporary folder ensuring automatic deletion when unlocked or during startup. Only attempts to delete unlocked files/folders.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    TemporaryFile(Path pathToFile, boolean isDirectory)
    Deprecated.
    Create a temporary file abstraction.
    protected
    TemporaryFile(TemporaryFileDirectory temporaryFolder, Path filePathRelativeToFolder, boolean isDirectory)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Creates lock file and, if isDirectory set to true also creates the empty folder.
    void
    Deprecated.
    Unlock the file/folder and remove it (recursively, if it's a folder).
    void
    dispose(boolean removeFile, boolean throwException)
    Deprecated.
    Unlock the file/folder and can remove it (recursively, if it's a folder).
    Deprecated.
    Provides full normalized path to managed file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TemporaryFile

      public TemporaryFile(Path pathToFile, boolean isDirectory)
      Deprecated.
      Create a temporary file abstraction. Doesn't actually perform any filesystem operations yet.
      Parameters:
      pathToFile - relative path to the new file/directory within bookmap temporary folder
      isDirectory - if true temporary file will be a directory, otherwise it's a plain file
    • TemporaryFile

      protected TemporaryFile(TemporaryFileDirectory temporaryFolder, Path filePathRelativeToFolder, boolean isDirectory)
      Deprecated.
  • Method Details

    • getPath

      public Path getPath()
      Deprecated.
      Provides full normalized path to managed file
    • create

      public void create()
      Deprecated.
      Creates lock file and, if isDirectory set to true also creates the empty folder.
    • dispose

      public void dispose()
      Deprecated.
      Unlock the file/folder and remove it (recursively, if it's a folder). Throws and exception is something goes wrong.
    • dispose

      public void dispose(boolean removeFile, boolean throwException)
      Deprecated.
      Unlock the file/folder and can remove it (recursively, if it's a folder). Can throw and exception is something goes wrong.
      Parameters:
      removeFile - if true - remove the locked file/folder
      throwException - if true - exception is thrown on failure. Otherwise it's logged but not thrown.