Package com.usatiuk.dhfsfs.objects

# Class FileHelper

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

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

## Constructor Summary

Constructors
Constructor
Description
`FileHelper()`

## Method Summary

Modifier and Type
Method
Description
`List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>>`
`getChunks(File file)`
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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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