Package org.duracloud.retrieval.mgmt
Class RetrievalWorker
- java.lang.Object
-
- org.duracloud.retrieval.mgmt.RetrievalWorker
-
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyTimestamps(ContentStream content, File localFile)protected booleanchecksumsMatch(File localFile)protected booleanchecksumsMatch(File localFile, String remoteChecksum)protected voiddeleteFile(File localFile)protected voidfail(String errMsg)protected StringgetChecksum(File localFile)protected Map<String,String>getContentProperties()FilegetLocalFile()protected voidmissing(String msg)protected voidnoChangeNeeded(String localFilePath)protected FilerenameFile(File localFile)Map<String,String>retrieveFile()Map<String,String>retrieveFile(RetrievalListener listener)protected Map<String,String>retrieveToFile(File localFile, RetrievalListener listener)Transfers the remote file stream to the local filevoidrun()protected voidsucceed(String localFilePath)
-
-
-
Constructor Detail
-
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 Detail
-
retrieveFile
public Map<String,String> retrieveFile(RetrievalListener listener)
-
getLocalFile
public File getLocalFile()
-
checksumsMatch
protected boolean checksumsMatch(File localFile) throws IOException
- Throws:
IOException
-
checksumsMatch
protected boolean checksumsMatch(File localFile, String remoteChecksum) throws IOException
- Throws:
IOException
-
getChecksum
protected String getChecksum(File localFile) throws IOException
- Throws:
IOException
-
renameFile
protected File renameFile(File localFile) throws IOException
- Throws:
IOException
-
deleteFile
protected void deleteFile(File localFile) throws IOException
- Throws:
IOException
-
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
protected void applyTimestamps(ContentStream content, File localFile)
-
noChangeNeeded
protected void noChangeNeeded(String localFilePath)
-
succeed
protected void succeed(String localFilePath)
-
fail
protected void fail(String errMsg)
-
missing
protected void missing(String msg)
-
-