Interface FileUtils.CollocatedTempFile

All Superinterfaces:
AutoCloseable, Closeable, FileUtils.TempFile
Enclosing class:
FileUtils

public static interface FileUtils.CollocatedTempFile extends FileUtils.TempFile
A collocated temporary file, that resides next to a "target" file, and is removed when closed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Upon close, atomically moves temp file to target file it is collocated with overwriting target (if exists).

    Methods inherited from interface java.io.Closeable

    close

    Methods inherited from interface org.eclipse.aether.util.FileUtils.TempFile

    getPath
  • Method Details

    • move

      void move() throws IOException
      Upon close, atomically moves temp file to target file it is collocated with overwriting target (if exists). Invocation of this method merely signals that caller ultimately wants temp file to replace the target file, but when this method returns, the move operation did not yet happen, it will happen when this instance is closed.

      Invoking this method without writing to temp file FileUtils.TempFile.getPath() (thus, not creating a temp file to be moved) is considered a bug, a mistake of the caller. Caller of this method should ensure that this method is invoked ONLY when the temp file is created and moving it to its final place is required.

      Throws:
      IOException