Package com.usatiuk.dhfsfs.objects
Class FileHelper
java.lang.Object
com.usatiuk.dhfsfs.objects.FileHelper
Helper class for working with files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList
<org.apache.commons.lang3.tuple.Pair<Long, JObjectKey>> Get the chunks of a file.void
replaceChunks
(File file, List<org.apache.commons.lang3.tuple.Pair<Long, JObjectKey>> chunks) Replace the chunks of a file.
-
Constructor Details
-
FileHelper
public FileHelper()
-
-
Method Details
-
getChunks
Get the chunks of a file. Transaction is expected to be already started.- Parameters:
file
- the file to get chunks from- Returns:
- a list of pairs of chunk offset and chunk key
-
replaceChunks
public void replaceChunks(File file, List<org.apache.commons.lang3.tuple.Pair<Long, JObjectKey>> chunks) Replace the chunks of a file. All previous chunks will be deleted. Transaction is expected to be already started.- Parameters:
file
- the file to replace chunks inchunks
- the list of pairs of chunk offset and chunk key
-