public class FileChunker extends Object
Constructor and Description |
---|
FileChunker(ContentWriter contentWriter) |
FileChunker(ContentWriter contentWriter,
FileChunkerOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
addContent(String destSpaceId,
String destContentId,
String fileChecksum,
File file)
This method pushes the content file to the space destSpaceId with the
content ID destContentId
|
void |
addContent(String destSpaceId,
String destContentId,
String fileChecksum,
long fileSize,
InputStream stream,
Map<String,String> properties)
This method pushes the content file to the space destSpaceId with the
content ID destContentId
|
protected void |
addContentFrom(File baseDir,
String destSpaceId)
This method loops the arg baseDir and pushes the found content to the
arg destSpace.
|
static DigestInputStream |
createTestContent(File outFile,
long size)
This method generates a test file with random char content.
|
protected void |
writeReport(File outputFile) |
public FileChunker(ContentWriter contentWriter)
public FileChunker(ContentWriter contentWriter, FileChunkerOptions options)
protected void writeReport(File outputFile)
public void addContent(String destSpaceId, String destContentId, String fileChecksum, File file)
destSpaceId
- of content destinationdestContentId
- of contentfileChecksum
- MD5 checksum of file or null if not knownfile
- to addpublic void addContent(String destSpaceId, String destContentId, String fileChecksum, long fileSize, InputStream stream, Map<String,String> properties)
destSpaceId
- of content destinationdestContentId
- of contentfileChecksum
- MD5 checksum of file or null if not knownstream
- to addproperties
- user-defined properties associated with contentprotected void addContentFrom(File baseDir, String destSpaceId)
baseDir
- of content to push to DataStoredestSpaceId
- of content destinationpublic static DigestInputStream createTestContent(File outFile, long size) throws IOException
outFile
- of test filesize
- number of bytes in test fileIOException
- on errorCopyright © 2009–2014 DuraSpace. All rights reserved.