| Modifier and Type | Method and Description |
|---|---|
static com.google.common.io.ByteSource |
asByteSource(Path thePath) |
static Path |
classPath(String thePath) |
static Path |
createTempDir() |
static void |
delete(Path thePath) |
static void |
deleteContents(Path thePath) |
static void |
deleteOnExit(Path thePath) |
static Stream<Path> |
list(Path theFile)
Convenience wrapper for
Files.list(java.nio.file.Path) which simply wraps the checked IOException as an
UncheckedIOException. |
static long |
numFilesInDirectory(Path directory)
Returns the number of files in a directory.
|
static long |
numFilesInDirectoryByPattern(Path directory,
String globPattern)
Returns the number of files in a directory that match the specified glob pattern.
|
static long |
size(Path theFile)
Convenience wrapper for
Files.size(java.nio.file.Path); returns the file size or 0L if the file does not exist
like File.length(). |
static String |
toString(Path thePath,
Charset theCharset) |
static Path |
withJarFileSystem(String thePath,
Class<?> theClass)
Returns a
Path object for the given context using a new jar-based FileSystem. |
static void |
write(String theInput,
Path theFile,
Charset theCharset) |
public static String toString(Path thePath, Charset theCharset) throws IOException
IOExceptionpublic static Path withJarFileSystem(String thePath, Class<?> theClass)
Path object for the given context using a new jar-based FileSystem.
The new FileSystem probably needs to be closed after using the Path object.public static com.google.common.io.ByteSource asByteSource(Path thePath)
public static void deleteOnExit(Path thePath)
public static void delete(Path thePath) throws IOException
IOExceptionpublic static void deleteContents(Path thePath) throws IOException
IOExceptionpublic static void write(String theInput, Path theFile, Charset theCharset) throws IOException
IOExceptionpublic static Path createTempDir()
@MustBeClosed public static Stream<Path> list(Path theFile)
Files.list(java.nio.file.Path) which simply wraps the checked IOException as an
UncheckedIOException.theFile - the fileFiles.list(java.nio.file.Path)UncheckedIOException - if Files.list(java.nio.file.Path) throws an IOExceptionpublic static long numFilesInDirectory(Path directory)
IllegalArgumentException - if the file could not otherwise be opened because it is not
a directory (optional specific exception)UncheckedIOException - if an I/O error occurs when opening the directorypublic static long numFilesInDirectoryByPattern(Path directory, String globPattern)
IllegalArgumentException - if the file could not otherwise be opened because it is not
a directory (optional specific exception)UncheckedIOException - if an I/O error occurs when opening the directorypublic static long size(Path theFile)
Files.size(java.nio.file.Path); returns the file size or 0L if the file does not exist
like File.length().theFile - the fileFiles.size(java.nio.file.Path), or 0L if the file does not existCopyright © 2010-2016 Stardog Union. All Rights Reserved.