public final class FileUtils
extends java.lang.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 java.io.InputStream |
getBoundedStream(java.io.InputStream stream,
int from,
int to)
Get a bounded inputstream.
|
static java.io.File |
getNquadsFile(java.io.File dir,
java.time.Instant time)
Get the nquads file for a given moment in time.
|
static java.io.File |
getResourceDirectory(java.io.File baseDirectory,
org.apache.commons.rdf.api.IRI identifier)
Get a directory for a given resource identifier.
|
static java.util.stream.Stream<org.apache.commons.rdf.api.Quad> |
parseQuad(java.lang.String line)
Parse a string into a stream of Quads.
|
static java.lang.String |
serializeQuad(org.apache.commons.rdf.api.Quad quad)
Serialize an RDF Quad.
|
static boolean |
uncheckedDeleteIfExists(java.nio.file.Path path)
Try to delete a file if it exists or throw an unchecked exception.
|
static java.util.stream.Stream<java.nio.file.Path> |
uncheckedList(java.nio.file.Path path)
Fetch a stream of files in the provided directory path.
|
static void |
writeMemento(java.io.File resourceDir,
org.trellisldp.api.Resource resource,
java.time.Instant time)
Write a Memento to a particular resource directory.
|
public static final int LENGTH
public static final int MAX
public static java.io.File getResourceDirectory(java.io.File baseDirectory,
org.apache.commons.rdf.api.IRI identifier)
baseDirectory - the base directoryidentifier - a resource identifierpublic static java.util.stream.Stream<org.apache.commons.rdf.api.Quad> parseQuad(java.lang.String line)
line - the line of textpublic static boolean uncheckedDeleteIfExists(java.nio.file.Path path)
path - the file pathpublic static java.util.stream.Stream<java.nio.file.Path> uncheckedList(java.nio.file.Path path)
path - the directory pathpublic static void writeMemento(java.io.File resourceDir,
org.trellisldp.api.Resource resource,
java.time.Instant time)
resourceDir - the resource directoryresource - the resourcetime - the time for the mementopublic static java.io.InputStream getBoundedStream(java.io.InputStream stream,
int from,
int to)
throws java.io.IOException
stream - the input streamfrom - the byte from which to startto - the byte to which to readjava.io.IOException - if an error occurs when skipping forwardpublic static java.lang.String serializeQuad(org.apache.commons.rdf.api.Quad quad)
quad - the quadpublic static java.io.File getNquadsFile(java.io.File dir,
java.time.Instant time)
dir - the directorytime - the time