Package org.duracloud.retrieval.mgmt
Class RetrievalWorker
java.lang.Object
org.duracloud.retrieval.mgmt.RetrievalWorker
- All Implemented Interfaces:
Runnable
Handles the retrieving of a single file from DuraCloud.
-
Constructor Summary
ConstructorsConstructorDescriptionRetrievalWorker(ContentItem contentItem, RetrievalSource source, File contentDir, boolean overwrite, OutputWriter outWriter, boolean createSpaceDir, boolean applyTimestamps) Creates a Retrieval Worker to handle retrieving a file -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyTimestamps(ContentStream content, File localFile) protected booleanchecksumsMatch(File localFile) protected booleanchecksumsMatch(File localFile, String remoteChecksum) protected voiddeleteFile(File localFile) protected voidprotected StringgetChecksum(File localFile) protected voidprotected voidnoChangeNeeded(String localFilePath) protected FilerenameFile(File localFile) retrieveFile(RetrievalListener listener) retrieveToFile(File localFile, RetrievalListener listener) Transfers the remote file stream to the local filevoidrun()protected void
-
Constructor Details
-
RetrievalWorker
public RetrievalWorker(ContentItem contentItem, RetrievalSource source, File contentDir, boolean overwrite, OutputWriter outWriter, boolean createSpaceDir, boolean applyTimestamps) Creates a Retrieval Worker to handle retrieving a file
-
-
Method Details
-
run
public void run() -
retrieveFile
-
retrieveFile
-
getLocalFile
-
checksumsMatch
- Throws:
IOException
-
checksumsMatch
- Throws:
IOException
-
getChecksum
- Throws:
IOException
-
renameFile
- Throws:
IOException
-
deleteFile
- Throws:
IOException
-
getContentProperties
-
retrieveToFile
protected Map<String,String> retrieveToFile(File localFile, RetrievalListener listener) throws IOException Transfers the remote file stream to the local file- Parameters:
localFile-listener-- Returns:
- Throws:
IOException
-
applyTimestamps
-
noChangeNeeded
-
succeed
-
fail
-
missing
-