FileSystemUtils

public interface FileSystemUtils

This class is mostly used for indirection in the tests. We just don’t like static utility classes. Created by ontotext on 2/2/14.

Methods

createDirectories

void createDirectories(File directory)

Create a directory and their parent directories as needed.

Parameters:
  • directory – the directory to create
Throws:
  • IOException – if there was an error while creating the directories

move

void move(Path path, Path filePath)

Move a path to another path.

Parameters:
  • path – the source
  • filePath – the destination
Throws:
  • IOException – if there was an error while moving the paths

readFully

byte[] readFully(Path path)

Read the specified path as byte array.

Parameters:
  • path – the path to read
Throws:
  • IOException – if there was an error while reading the content
Returns:

the path content

touch

void touch(Path pathToCreate)

Creates the specified path with empty content.

Parameters:
  • pathToCreate – the path to create
Throws:
  • IOException – if there was error while creating the path

write

void write(Path path, byte[] value)

Write the byte value to the specified path.

Parameters:
  • path – the path
  • value – the value
Throws:
  • IOException – if there was an error while writing the content