Package | Description |
---|---|
nl.esciencecenter.xenon |
This package is the main entry point into the Xenon API.
|
nl.esciencecenter.xenon.util |
This package is contains several utility classes.
|
Modifier and Type | Method and Description |
---|---|
Files |
Xenon.files()
Retrieve the
Files interface. |
Modifier and Type | Method and Description |
---|---|
static long |
Utils.copy(Files files,
InputStream in,
Path target,
boolean truncate)
Copies all bytes from an input stream to a file.
|
static long |
Utils.copy(Files files,
Path source,
OutputStream out)
Copies all bytes from a file to an output stream.
|
static Path |
Utils.fromLocalPath(Files files,
String path)
Takes the String representation of a local path (for example "/bin/foo" or "C:\dir\test.txt") and converts it into a
Path . |
static Path |
Utils.getLocalCWD(Files files)
Returns a
Path that represents the current working directory. |
static FileSystem[] |
Utils.getLocalFileSystems(Files files)
Returns all local FileSystems.
|
static Path |
Utils.getLocalHome(Files files)
Returns a
Path that represents the home directory of the current user. |
static BufferedReader |
Utils.newBufferedReader(Files files,
Path source,
Charset cs)
Opens a file for reading, returning a
BufferedReader that may be used to read text from the file in an
efficient manner. |
static BufferedWriter |
Utils.newBufferedWriter(Files files,
Path target,
Charset cs,
boolean truncate)
Opens or creates a file for writing, returning a BufferedWriter that may be used to write text to the file in an efficient
manner.
|
FileVisitResult |
FileVisitor.postVisitDirectory(Path dir,
XenonException exception,
Files files)
Invoked for a directory after entries in the directory, and all of their descendants, have been visited.
|
FileVisitResult |
FileVisitor.preVisitDirectory(Path dir,
FileAttributes attributes,
Files files)
Invoked for a directory before entries in the directory are visited.
|
static byte[] |
Utils.readAllBytes(Files files,
Path source)
Read all the bytes from a file and return them as a
byte[]<\code>. |
static List<String> |
Utils.readAllLines(Files files,
Path source,
Charset cs)
Read all lines from a file and return them in a
List . |
static String |
Utils.readToString(Files files,
Path source,
Charset cs)
Read all the bytes from a file and return them as a
String<\code> using the |
static void |
Utils.recursiveCopy(Files files,
Path source,
Path target,
CopyOption... options)
Recursively copies directories, files and symbolic links from source to target.
|
static void |
Utils.recursiveDelete(Files files,
Path path)
Recursively removes all directories, files and symbolic links in path.
|
static Path |
Utils.resolveWithEntryPath(Files files,
FileSystem fileSystem,
String... path)
Resolve a relative
path with the entry path of the fileSystem and return a new
Path that represents this location. |
static Path |
Utils.resolveWithRoot(Files files,
Path root,
String... path)
|
FileVisitResult |
FileVisitor.visitFile(Path file,
FileAttributes attributes,
Files files)
Invoked for a file in a directory.
|
FileVisitResult |
FileVisitor.visitFileFailed(Path file,
XenonException exception,
Files files)
Invoked for a file that could not be visited.
|
static void |
Utils.walkFileTree(Files files,
Path start,
boolean followLinks,
int maxDepth,
FileVisitor visitor)
Walks a file tree.
|
static void |
Utils.walkFileTree(Files files,
Path start,
FileVisitor visitor)
Walks over a file tree.
|
static void |
Utils.write(Files files,
Path target,
byte[] bytes,
boolean truncate)
Writes bytes to a file.
|
static void |
Utils.write(Files files,
Path target,
Iterable<? extends CharSequence> lines,
Charset cs,
boolean truncate)
Write lines of text to a file.
|
Constructor and Description |
---|
Sandbox(Files files,
Path root,
String sandboxName)
Creates a sandbox.
|