public final class FileUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
LENGTH
The length of the CRC directory partition.
|
static int |
MAX |
Modifier and Type | Method and Description |
---|---|
static InputStream |
getBoundedStream(InputStream stream,
int from,
int to)
Get a bounded inputstream.
|
static File |
getNquadsFile(File dir,
Instant time)
Get the nquads file for a given moment in time.
|
static File |
getResourceDirectory(File baseDirectory,
IRI identifier)
Get a directory for a given resource identifier.
|
static Stream<Quad> |
parseQuad(String line)
Parse a string into a stream of Quads.
|
static String |
serializeQuad(Quad quad)
Serialize an RDF Quad.
|
static boolean |
uncheckedDeleteIfExists(Path path)
Try to delete a file if it exists or throw an unchecked exception.
|
static Stream<Path> |
uncheckedList(Path path)
Fetch a stream of files in the provided directory path.
|
static void |
writeMemento(File resourceDir,
Resource resource,
Instant time)
Write a Memento to a particular resource directory.
|
public static final int LENGTH
public static final int MAX
public static File getResourceDirectory(File baseDirectory, IRI identifier)
baseDirectory
- the base directoryidentifier
- a resource identifierpublic static Stream<Quad> parseQuad(String line)
line
- the line of textpublic static boolean uncheckedDeleteIfExists(Path path)
path
- the file pathpublic static Stream<Path> uncheckedList(Path path)
path
- the directory pathpublic static void writeMemento(File resourceDir, Resource resource, Instant time)
resourceDir
- the resource directoryresource
- the resourcetime
- the time for the mementopublic static InputStream getBoundedStream(InputStream stream, int from, int to) throws IOException
stream
- the input streamfrom
- the byte from which to startto
- the byte to which to readIOException
- if an error occurs when skipping forwardpublic static String serializeQuad(Quad quad)
quad
- the quad