public final class FilesUncheck
extends java.lang.Object
Files to uncheck calls by throwing UncheckedIOException instead of IOException.Files,
IOException,
UncheckedIOException| Modifier | Constructor and Description |
|---|---|
private |
FilesUncheck()
No instances.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
copy(java.io.InputStream in,
java.nio.file.Path target,
java.nio.file.CopyOption... options)
Delegates to
Files.copy(InputStream, Path, CopyOption...) throwing UncheckedIOException instead of
IOException. |
static long |
copy(java.nio.file.Path source,
java.io.OutputStream out)
Delegates to
Files.copy(Path, OutputStream) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
copy(java.nio.file.Path source,
java.nio.file.Path target,
java.nio.file.CopyOption... options)
Delegates to
Files.copy(Path, Path, CopyOption...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
createDirectories(java.nio.file.Path dir,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createDirectories(Path, FileAttribute...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
createDirectory(java.nio.file.Path dir,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createDirectory(Path, FileAttribute...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
createFile(java.nio.file.Path path,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createFile(Path, FileAttribute...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
createLink(java.nio.file.Path link,
java.nio.file.Path existing)
Delegates to
Files.createLink(Path, Path) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
createSymbolicLink(java.nio.file.Path link,
java.nio.file.Path target,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createSymbolicLink(Path, Path, FileAttribute...) throwing UncheckedIOException
instead of IOException. |
static java.nio.file.Path |
createTempDirectory(java.nio.file.Path dir,
java.lang.String prefix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createTempDirectory(Path, String, FileAttribute...) throwing UncheckedIOException
instead of IOException. |
static java.nio.file.Path |
createTempDirectory(java.lang.String prefix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createTempDirectory(String, FileAttribute...) throwing UncheckedIOException
instead of IOException. |
static java.nio.file.Path |
createTempFile(java.nio.file.Path dir,
java.lang.String prefix,
java.lang.String suffix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createTempFile(Path, String, String, FileAttribute...) throwing
UncheckedIOException instead of IOException. |
static java.nio.file.Path |
createTempFile(java.lang.String prefix,
java.lang.String suffix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.createTempFile(String, String, FileAttribute...) throwing UncheckedIOException
instead of IOException. |
static void |
delete(java.nio.file.Path path)
Delegates to
Files.delete(Path) throwing UncheckedIOException instead of IOException. |
static boolean |
deleteIfExists(java.nio.file.Path path)
Delegates to
Files.deleteIfExists(Path) throwing UncheckedIOException instead of IOException. |
static java.util.stream.Stream<java.nio.file.Path> |
find(java.nio.file.Path start,
int maxDepth,
java.util.function.BiPredicate<java.nio.file.Path,java.nio.file.attribute.BasicFileAttributes> matcher,
java.nio.file.FileVisitOption... options)
Delegates to
Files.find(Path, int, BiPredicate, FileVisitOption...) throwing UncheckedIOException instead of IOException. |
static java.lang.Object |
getAttribute(java.nio.file.Path path,
java.lang.String attribute,
java.nio.file.LinkOption... options)
Delegates to
Files.getAttribute(Path, String, LinkOption...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.FileStore |
getFileStore(java.nio.file.Path path)
Delegates to
Files.getFileStore(Path) throwing UncheckedIOException instead of IOException. |
static java.nio.file.attribute.FileTime |
getLastModifiedTime(java.nio.file.Path path,
java.nio.file.LinkOption... options)
Delegates to
Files.getLastModifiedTime(Path, LinkOption...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.attribute.UserPrincipal |
getOwner(java.nio.file.Path path,
java.nio.file.LinkOption... options)
Delegates to
Files.getOwner(Path, LinkOption...) throwing UncheckedIOException instead of
IOException. |
static java.util.Set<java.nio.file.attribute.PosixFilePermission> |
getPosixFilePermissions(java.nio.file.Path path,
java.nio.file.LinkOption... options)
Delegates to
Files.getPosixFilePermissions(Path, LinkOption...) throwing UncheckedIOException instead
of IOException. |
static boolean |
isHidden(java.nio.file.Path path)
Delegates to
Files.isHidden(Path) throwing UncheckedIOException instead of IOException. |
static boolean |
isSameFile(java.nio.file.Path path,
java.nio.file.Path path2)
Delegates to
Files.isSameFile(Path, Path) throwing UncheckedIOException instead of
IOException. |
static java.util.stream.Stream<java.lang.String> |
lines(java.nio.file.Path path)
Delegates to
Files.lines(Path) throwing UncheckedIOException instead of IOException. |
static java.util.stream.Stream<java.lang.String> |
lines(java.nio.file.Path path,
java.nio.charset.Charset cs)
Delegates to
Files.lines(Path, Charset) throwing UncheckedIOException instead of IOException. |
static java.util.stream.Stream<java.nio.file.Path> |
list(java.nio.file.Path dir)
Delegates to
Files.list(Path) throwing UncheckedIOException instead of IOException. |
static java.nio.file.Path |
move(java.nio.file.Path source,
java.nio.file.Path target,
java.nio.file.CopyOption... options)
Delegates to
Files.move(Path, Path, CopyOption...) throwing UncheckedIOException instead of
IOException. |
static java.io.BufferedReader |
newBufferedReader(java.nio.file.Path path)
Delegates to
Files.newBufferedReader(Path) throwing UncheckedIOException instead of
IOException. |
static java.io.BufferedReader |
newBufferedReader(java.nio.file.Path path,
java.nio.charset.Charset cs)
Delegates to
Files.newBufferedReader(Path, Charset) throwing UncheckedIOException instead of
IOException. |
static java.io.BufferedWriter |
newBufferedWriter(java.nio.file.Path path,
java.nio.charset.Charset cs,
java.nio.file.OpenOption... options)
Delegates to
Files.newBufferedWriter(Path, Charset, OpenOption...) throwing UncheckedIOException
instead of IOException. |
static java.io.BufferedWriter |
newBufferedWriter(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Delegates to
Files.newBufferedWriter(Path, OpenOption...) throwing UncheckedIOException instead of
IOException. |
static java.nio.channels.SeekableByteChannel |
newByteChannel(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Delegates to
Files.newByteChannel(Path, OpenOption...) throwing UncheckedIOException instead of
IOException. |
static java.nio.channels.SeekableByteChannel |
newByteChannel(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates to
Files.newByteChannel(Path, Set, FileAttribute...) throwing UncheckedIOException instead
of IOException. |
static java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(java.nio.file.Path dir)
Delegates to
Files.newDirectoryStream(Path) throwing UncheckedIOException instead of IOException. |
static java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(java.nio.file.Path dir,
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
Delegates to
Files.newDirectoryStream(Path, java.nio.file.DirectoryStream.Filter) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(java.nio.file.Path dir,
java.lang.String glob)
Delegates to
Files.newDirectoryStream(Path, String) throwing UncheckedIOException instead of
IOException. |
static java.io.InputStream |
newInputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Delegates to
Files.newInputStream(Path, OpenOption...) throwing UncheckedIOException instead of
IOException. |
static java.io.OutputStream |
newOutputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Delegates to
Files.newOutputStream(Path, OpenOption...) throwing UncheckedIOException instead of
IOException. |
static java.lang.String |
probeContentType(java.nio.file.Path path)
Delegates to
Files.probeContentType(Path) throwing UncheckedIOException instead of
IOException. |
static byte[] |
readAllBytes(java.nio.file.Path path)
Delegates to
Files.readAllBytes(Path) throwing UncheckedIOException instead of IOException. |
static java.util.List<java.lang.String> |
readAllLines(java.nio.file.Path path)
Delegates to
Files.readAllLines(Path) throwing UncheckedIOException instead of IOException. |
static java.util.List<java.lang.String> |
readAllLines(java.nio.file.Path path,
java.nio.charset.Charset cs)
Delegates to
Files.readAllLines(Path, Charset) throwing UncheckedIOException instead of
IOException. |
static <A extends java.nio.file.attribute.BasicFileAttributes> |
readAttributes(java.nio.file.Path path,
java.lang.Class<A> type,
java.nio.file.LinkOption... options)
Delegates to
Files.readAttributes(Path, Class, LinkOption...) throwing UncheckedIOException instead
of IOException. |
static java.util.Map<java.lang.String,java.lang.Object> |
readAttributes(java.nio.file.Path path,
java.lang.String attributes,
java.nio.file.LinkOption... options)
Delegates to
Files.readAttributes(Path, String, LinkOption...) throwing UncheckedIOException instead
of IOException. |
static java.nio.file.Path |
readSymbolicLink(java.nio.file.Path link)
Delegates to
Files.readSymbolicLink(Path) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
setAttribute(java.nio.file.Path path,
java.lang.String attribute,
java.lang.Object value,
java.nio.file.LinkOption... options)
Delegates to
Files.setAttribute(Path, String, Object, LinkOption...) throwing UncheckedIOException
instead of IOException. |
static java.nio.file.Path |
setLastModifiedTime(java.nio.file.Path path,
java.nio.file.attribute.FileTime time)
Delegates to
Files.setLastModifiedTime(Path, FileTime) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
setOwner(java.nio.file.Path path,
java.nio.file.attribute.UserPrincipal owner)
Delegates to
Files.setOwner(Path, UserPrincipal) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
setPosixFilePermissions(java.nio.file.Path path,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
Delegates to
Files.setPosixFilePermissions(Path, Set) throwing UncheckedIOException instead of
IOException. |
static long |
size(java.nio.file.Path path)
Delegates to
Files.size(Path) throwing UncheckedIOException instead of IOException. |
static java.util.stream.Stream<java.nio.file.Path> |
walk(java.nio.file.Path start,
java.nio.file.FileVisitOption... options)
Delegates to
Files.walk(Path, FileVisitOption...) throwing UncheckedIOException instead of IOException. |
static java.util.stream.Stream<java.nio.file.Path> |
walk(java.nio.file.Path start,
int maxDepth,
java.nio.file.FileVisitOption... options)
Delegates to
Files.walk(Path, int, FileVisitOption...) throwing UncheckedIOException instead of IOException. |
static java.nio.file.Path |
walkFileTree(java.nio.file.Path start,
java.nio.file.FileVisitor<? super java.nio.file.Path> visitor)
Delegates to
Files.walkFileTree(Path, FileVisitor) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
walkFileTree(java.nio.file.Path start,
java.util.Set<java.nio.file.FileVisitOption> options,
int maxDepth,
java.nio.file.FileVisitor<? super java.nio.file.Path> visitor)
Delegates to
Files.walkFileTree(Path, Set, int, FileVisitor) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
write(java.nio.file.Path path,
byte[] bytes,
java.nio.file.OpenOption... options)
Delegates to
Files.write(Path, byte[], OpenOption...) throwing UncheckedIOException instead of
IOException. |
static java.nio.file.Path |
write(java.nio.file.Path path,
java.lang.Iterable<? extends java.lang.CharSequence> lines,
java.nio.charset.Charset cs,
java.nio.file.OpenOption... options)
Delegates to
Files.write(Path, Iterable, Charset, OpenOption...) throwing UncheckedIOException
instead of IOException. |
static java.nio.file.Path |
write(java.nio.file.Path path,
java.lang.Iterable<? extends java.lang.CharSequence> lines,
java.nio.file.OpenOption... options)
Delegates to
Files.write(Path, Iterable, OpenOption...) throwing UncheckedIOException instead of
IOException. |
public static long copy(java.io.InputStream in,
java.nio.file.Path target,
java.nio.file.CopyOption... options)
Files.copy(InputStream, Path, CopyOption...) throwing UncheckedIOException instead of
IOException.in - See delegate.target - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.Files.copy(InputStream, Path,CopyOption...)public static long copy(java.nio.file.Path source,
java.io.OutputStream out)
Files.copy(Path, OutputStream) throwing UncheckedIOException instead of
IOException.source - See delegate. See delegate.out - See delegate. See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path copy(java.nio.file.Path source,
java.nio.file.Path target,
java.nio.file.CopyOption... options)
Files.copy(Path, Path, CopyOption...) throwing UncheckedIOException instead of
IOException.source - See delegate.target - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createDirectories(java.nio.file.Path dir,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createDirectories(Path, FileAttribute...) throwing UncheckedIOException instead of
IOException.dir - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createDirectory(java.nio.file.Path dir,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createDirectory(Path, FileAttribute...) throwing UncheckedIOException instead of
IOException.dir - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createFile(java.nio.file.Path path,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createFile(Path, FileAttribute...) throwing UncheckedIOException instead of
IOException.path - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createLink(java.nio.file.Path link,
java.nio.file.Path existing)
Files.createLink(Path, Path) throwing UncheckedIOException instead of
IOException.link - See delegate.existing - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createSymbolicLink(java.nio.file.Path link,
java.nio.file.Path target,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createSymbolicLink(Path, Path, FileAttribute...) throwing UncheckedIOException
instead of IOException.link - See delegate.target - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createTempDirectory(java.nio.file.Path dir,
java.lang.String prefix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createTempDirectory(Path, String, FileAttribute...) throwing UncheckedIOException
instead of IOException.dir - See delegate.prefix - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createTempDirectory(java.lang.String prefix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createTempDirectory(String, FileAttribute...) throwing UncheckedIOException
instead of IOException.prefix - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createTempFile(java.nio.file.Path dir,
java.lang.String prefix,
java.lang.String suffix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createTempFile(Path, String, String, FileAttribute...) throwing
UncheckedIOException instead of IOException.dir - See delegate.prefix - See delegate.suffix - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path createTempFile(java.lang.String prefix,
java.lang.String suffix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.createTempFile(String, String, FileAttribute...) throwing UncheckedIOException
instead of IOException.prefix - See delegate.suffix - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static void delete(java.nio.file.Path path)
Files.delete(Path) throwing UncheckedIOException instead of IOException.path - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static boolean deleteIfExists(java.nio.file.Path path)
Files.deleteIfExists(Path) throwing UncheckedIOException instead of IOException.path - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.util.stream.Stream<java.nio.file.Path> find(java.nio.file.Path start,
int maxDepth,
java.util.function.BiPredicate<java.nio.file.Path,java.nio.file.attribute.BasicFileAttributes> matcher,
java.nio.file.FileVisitOption... options)
Files.find(Path, int, BiPredicate, FileVisitOption...) throwing UncheckedIOException instead of IOException.
The returned Stream wraps a DirectoryStream. When you require timely disposal of file system resources, use a try-with-resources
block to ensure invocation of the stream's BaseStream.close() method after the stream operations are completed.
start - See delegate.maxDepth - See delegate.matcher - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.lang.Object getAttribute(java.nio.file.Path path,
java.lang.String attribute,
java.nio.file.LinkOption... options)
Files.getAttribute(Path, String, LinkOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.attribute - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.FileStore getFileStore(java.nio.file.Path path)
Files.getFileStore(Path) throwing UncheckedIOException instead of IOException.path - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.attribute.FileTime getLastModifiedTime(java.nio.file.Path path,
java.nio.file.LinkOption... options)
Files.getLastModifiedTime(Path, LinkOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.attribute.UserPrincipal getOwner(java.nio.file.Path path,
java.nio.file.LinkOption... options)
Files.getOwner(Path, LinkOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.util.Set<java.nio.file.attribute.PosixFilePermission> getPosixFilePermissions(java.nio.file.Path path,
java.nio.file.LinkOption... options)
Files.getPosixFilePermissions(Path, LinkOption...) throwing UncheckedIOException instead
of IOException.path - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static boolean isHidden(java.nio.file.Path path)
Files.isHidden(Path) throwing UncheckedIOException instead of IOException.path - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static boolean isSameFile(java.nio.file.Path path,
java.nio.file.Path path2)
Files.isSameFile(Path, Path) throwing UncheckedIOException instead of
IOException.path - See delegate.path2 - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path path)
Files.lines(Path) throwing UncheckedIOException instead of IOException.
The returned Stream wraps a Reader. When you require timely disposal of file system resources, use a try-with-resources block to
ensure invocation of the stream's BaseStream.close() method after the stream operations are completed.
path - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path path,
java.nio.charset.Charset cs)
Files.lines(Path, Charset) throwing UncheckedIOException instead of IOException.
The returned Stream wraps a Reader. When you require timely disposal of file system resources, use a try-with-resources block to
ensure invocation of the stream's BaseStream.close() method after the stream operations are completed.
path - See delegate.cs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.util.stream.Stream<java.nio.file.Path> list(java.nio.file.Path dir)
Files.list(Path) throwing UncheckedIOException instead of IOException.
The returned Stream wraps a DirectoryStream. When you require timely disposal of file system resources, use a try-with-resources
block to ensure invocation of the stream's BaseStream.close() method after the stream operations are completed.
dir - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.Path move(java.nio.file.Path source,
java.nio.file.Path target,
java.nio.file.CopyOption... options)
Files.move(Path, Path, CopyOption...) throwing UncheckedIOException instead of
IOException.source - See delegate.target - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.io.BufferedReader newBufferedReader(java.nio.file.Path path)
Files.newBufferedReader(Path) throwing UncheckedIOException instead of
IOException.path - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.io.BufferedReader newBufferedReader(java.nio.file.Path path,
java.nio.charset.Charset cs)
Files.newBufferedReader(Path, Charset) throwing UncheckedIOException instead of
IOException.path - See delegate.cs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path path,
java.nio.charset.Charset cs,
java.nio.file.OpenOption... options)
Files.newBufferedWriter(Path, Charset, OpenOption...) throwing UncheckedIOException
instead of IOException.path - See delegate.cs - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Files.newBufferedWriter(Path, OpenOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Files.newByteChannel(Path, OpenOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.options - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs)
Files.newByteChannel(Path, Set, FileAttribute...) throwing UncheckedIOException instead
of IOException.path - See delegate.options - See delegate.attrs - See delegate.java.io.UncheckedIOException - Wraps an IOException.public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir)
Files.newDirectoryStream(Path) throwing UncheckedIOException instead of IOException.
If you don't use the try-with-resources construct, then you must call the stream's BaseStream.close() method after iteration is complete to free any
resources held for the open directory.
dir - See delegate.public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir,
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)
Files.newDirectoryStream(Path, java.nio.file.DirectoryStream.Filter) throwing UncheckedIOException instead of
IOException.
If you don't use the try-with-resources construct, then you must call the stream's BaseStream.close() method after iteration is complete to free any
resources held for the open directory.
dir - See delegate.filter - See delegate.public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir,
java.lang.String glob)
Files.newDirectoryStream(Path, String) throwing UncheckedIOException instead of
IOException.
The returned Stream wraps a DirectoryStream. When you require timely disposal of file system resources, use a try-with-resources
block to ensure invocation of the stream's BaseStream.close() method after the stream operations are completed.
dir - See delegate.glob - See delegate.public static java.io.InputStream newInputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Files.newInputStream(Path, OpenOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.options - See delegate.public static java.io.OutputStream newOutputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options)
Files.newOutputStream(Path, OpenOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.options - See delegate.public static java.lang.String probeContentType(java.nio.file.Path path)
Files.probeContentType(Path) throwing UncheckedIOException instead of
IOException.path - See delegate.public static byte[] readAllBytes(java.nio.file.Path path)
Files.readAllBytes(Path) throwing UncheckedIOException instead of IOException.path - See delegate.public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path path)
Files.readAllLines(Path) throwing UncheckedIOException instead of IOException.path - See delegate.public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path path,
java.nio.charset.Charset cs)
Files.readAllLines(Path, Charset) throwing UncheckedIOException instead of
IOException.path - See delegate.cs - See delegate.public static <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path path,
java.lang.Class<A> type,
java.nio.file.LinkOption... options)
Files.readAttributes(Path, Class, LinkOption...) throwing UncheckedIOException instead
of IOException.A - See delegate.path - See delegate.type - See delegate.options - See delegate.public static java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path path,
java.lang.String attributes,
java.nio.file.LinkOption... options)
Files.readAttributes(Path, String, LinkOption...) throwing UncheckedIOException instead
of IOException.path - See delegate.attributes - See delegate.options - See delegate.public static java.nio.file.Path readSymbolicLink(java.nio.file.Path link)
Files.readSymbolicLink(Path) throwing UncheckedIOException instead of
IOException.link - See delegate.public static java.nio.file.Path setAttribute(java.nio.file.Path path,
java.lang.String attribute,
java.lang.Object value,
java.nio.file.LinkOption... options)
Files.setAttribute(Path, String, Object, LinkOption...) throwing UncheckedIOException
instead of IOException.path - See delegate.attribute - See delegate.value - See delegate.options - See delegate.public static java.nio.file.Path setLastModifiedTime(java.nio.file.Path path,
java.nio.file.attribute.FileTime time)
Files.setLastModifiedTime(Path, FileTime) throwing UncheckedIOException instead of
IOException.path - See delegate.time - See delegate.public static java.nio.file.Path setOwner(java.nio.file.Path path,
java.nio.file.attribute.UserPrincipal owner)
Files.setOwner(Path, UserPrincipal) throwing UncheckedIOException instead of
IOException.path - See delegate.owner - See delegate.public static java.nio.file.Path setPosixFilePermissions(java.nio.file.Path path,
java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
Files.setPosixFilePermissions(Path, Set) throwing UncheckedIOException instead of
IOException.path - See delegate.perms - See delegate.public static long size(java.nio.file.Path path)
Files.size(Path) throwing UncheckedIOException instead of IOException.path - See delegate.public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path start,
java.nio.file.FileVisitOption... options)
Files.walk(Path, FileVisitOption...) throwing UncheckedIOException instead of IOException.
The returned Stream may wrap one or more DirectoryStreams. When you require timely disposal of file system resources, use a
try-with-resources block to ensure invocation of the stream's BaseStream.close() method after the stream operations are completed. Calling a
closed stream causes a IllegalStateException.
start - See delegate.options - See delegate.public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path start,
int maxDepth,
java.nio.file.FileVisitOption... options)
Files.walk(Path, int, FileVisitOption...) throwing UncheckedIOException instead of IOException.
The returned Stream may wrap one or more DirectoryStreams. When you require timely disposal of file system resources, use a
try-with-resources block to ensure invocation of the stream's BaseStream.close() method after the stream operations are completed. Calling a
closed stream causes a IllegalStateException.
start - See delegate.maxDepth - See delegate.options - See delegate.public static java.nio.file.Path walkFileTree(java.nio.file.Path start,
java.nio.file.FileVisitor<? super java.nio.file.Path> visitor)
Files.walkFileTree(Path, FileVisitor) throwing UncheckedIOException instead of
IOException.start - See delegate.visitor - See delegate.public static java.nio.file.Path walkFileTree(java.nio.file.Path start,
java.util.Set<java.nio.file.FileVisitOption> options,
int maxDepth,
java.nio.file.FileVisitor<? super java.nio.file.Path> visitor)
Files.walkFileTree(Path, Set, int, FileVisitor) throwing UncheckedIOException instead of
IOException.start - See delegate.options - See delegate.maxDepth - See delegate.visitor - See delegate.public static java.nio.file.Path write(java.nio.file.Path path,
byte[] bytes,
java.nio.file.OpenOption... options)
Files.write(Path, byte[], OpenOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.bytes - See delegate.options - See delegate.public static java.nio.file.Path write(java.nio.file.Path path,
java.lang.Iterable<? extends java.lang.CharSequence> lines,
java.nio.charset.Charset cs,
java.nio.file.OpenOption... options)
Files.write(Path, Iterable, Charset, OpenOption...) throwing UncheckedIOException
instead of IOException.path - See delegate.lines - See delegate.cs - See delegate.options - See delegate.public static java.nio.file.Path write(java.nio.file.Path path,
java.lang.Iterable<? extends java.lang.CharSequence> lines,
java.nio.file.OpenOption... options)
Files.write(Path, Iterable, OpenOption...) throwing UncheckedIOException instead of
IOException.path - See delegate.lines - See delegate.options - See delegate.