Class 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 Detail

      • 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