Class TestRemoteFile

    • Field Detail

      • failsOnCopy

        public boolean failsOnCopy
    • Constructor Detail

      • TestRemoteFile

        public TestRemoteFile​(File localFile,
                              boolean useChecksum,
                              boolean fileDeletable,
                              boolean multipleDownloads)
                       throws IOFailure
        Throws:
        IOFailure
    • Method Detail

      • copyTo

        public void copyTo​(File destFile)
        Description copied from class: HTTPRemoteFile
        Copy this remote file to the given file. If the file resides on the current machine, remote file transfer is done locally. Otherwise, the remote file is transferred over http. If the file is not set to be able to be transferred multiple times, it is cleaned up after the transfer.
        Specified by:
        copyTo in interface RemoteFile
        Overrides:
        copyTo in class HTTPRemoteFile
        Parameters:
        destFile - The file to write the remote file to.
      • appendTo

        public void appendTo​(OutputStream out)
        Description copied from class: AbstractRemoteFile
        Append this remote file to the given output stream. This method will use getInputStream to get the remote stream, and then copy that stream to the given output stream.
        Specified by:
        appendTo in interface RemoteFile
        Overrides:
        appendTo in class AbstractRemoteFile
        Parameters:
        out - The stream to write the remote file to.
      • cleanup

        public void cleanup()
        Description copied from class: HTTPRemoteFile
        Invalidate all file handles, by asking the remote registry to remove the url for this remote file from the list of shared files. Invalidating a file handle may delete the original files, if deletable. This method does not throw exceptions, but will warn on errors.
        Specified by:
        cleanup in interface RemoteFile
        Overrides:
        cleanup in class HTTPRemoteFile
      • isDeleted

        public boolean isDeleted()
      • removeRemainingFiles

        public static void removeRemainingFiles()
        Remove any remote files that may have been left over.
      • remainingFiles

        public static Set<RemoteFile> remainingFiles()
        Give the set of remaining remote files.
        Returns:
        the Set of remaining files
      • getFile

        public File getFile()
      • isLocal

        protected boolean isLocal()
        Description copied from class: HTTPRemoteFile
        Helper method to determine if file resides on local machine.
        Overrides:
        isLocal in class HTTPRemoteFile
        Returns:
        true if the file is on the local machine, false otherwise.