Class FileHelper

java.lang.Object
com.usatiuk.dhfsfs.objects.FileHelper

@ApplicationScoped public class FileHelper extends Object
Helper class for working with files.
  • Constructor Details

    • FileHelper

      public FileHelper()
  • Method Details

    • getChunks

      public List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>> getChunks(File file)
      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 in
      chunks - the list of pairs of chunk offset and chunk key