Class MavenArtifact.TemporaryFile

java.lang.Object
hudson.maven.reporters.MavenArtifact.TemporaryFile
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
MavenArtifact

public final class MavenArtifact.TemporaryFile extends Object implements Closeable
Representation of an archived artifact that might be accessed in various ways. Release in a finally-block.
Since:
2.0.3
  • Method Details

    • getVirtualFile

      @NonNull public VirtualFile getVirtualFile()
      Gets the artifact from whatever storage mechanism is appropriate. This is the preferred method for code that does not need to deal with File specifically.
      Returns:
      the purported location of the artifact (might no longer exist if it has since been deleted)
    • getFile

      @NonNull public File getFile() throws IOException
      Gets the artifact as a local file, perhaps creating a temporary copy as needed. You must close() it when finished; do not delete the result file yourself.
      Returns:
      either the original artifact, or a copy thereof; may not exist if it has since been deleted
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException