Class FilesUncheck
- java.lang.Object
-
- org.apache.commons.io.file.FilesUncheck
-
public final class FilesUncheck extends java.lang.Object
Delegates toFiles
to uncheck calls by throwingUncheckedIOException
instead ofIOException
.- Since:
- 2.12.0
- See Also:
Files
,IOException
,UncheckedIOException
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
copy(java.io.InputStream in, java.nio.file.Path target, java.nio.file.CopyOption... options)
Delegates toFiles.copy(InputStream, Path, CopyOption...)
throwingUncheckedIOException
instead ofIOException
.static long
copy(java.nio.file.Path source, java.io.OutputStream out)
Delegates toFiles.copy(Path, OutputStream)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
copy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)
Delegates toFiles.copy(Path, Path, CopyOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createDirectories(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createDirectories(Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createDirectory(Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createFile(java.nio.file.Path path, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createFile(Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createLink(java.nio.file.Path link, java.nio.file.Path existing)
Delegates toFiles.createLink(Path, Path)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createSymbolicLink(java.nio.file.Path link, java.nio.file.Path target, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createSymbolicLink(Path, Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createTempDirectory(java.lang.String prefix, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createTempDirectory(String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createTempDirectory(java.nio.file.Path dir, java.lang.String prefix, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createTempDirectory(Path, String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
createTempFile(java.lang.String prefix, java.lang.String suffix, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createTempFile(String, String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.createTempFile(Path, String, String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static void
delete(java.nio.file.Path path)
Delegates toFiles.delete(Path)
throwingUncheckedIOException
instead ofIOException
.static boolean
deleteIfExists(java.nio.file.Path path)
Delegates toFiles.deleteIfExists(Path)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.find(Path, int, BiPredicate, FileVisitOption...)
throwingUncheckedIOException
instead ofIOException
.static java.lang.Object
getAttribute(java.nio.file.Path path, java.lang.String attribute, java.nio.file.LinkOption... options)
Delegates toFiles.getAttribute(Path, String, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.FileStore
getFileStore(java.nio.file.Path path)
Delegates toFiles.getFileStore(Path)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.attribute.FileTime
getLastModifiedTime(java.nio.file.Path path, java.nio.file.LinkOption... options)
Delegates toFiles.getLastModifiedTime(Path, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.attribute.UserPrincipal
getOwner(java.nio.file.Path path, java.nio.file.LinkOption... options)
Delegates toFiles.getOwner(Path, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.static java.util.Set<java.nio.file.attribute.PosixFilePermission>
getPosixFilePermissions(java.nio.file.Path path, java.nio.file.LinkOption... options)
Delegates toFiles.getPosixFilePermissions(Path, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.static boolean
isHidden(java.nio.file.Path path)
Delegates toFiles.isHidden(Path)
throwingUncheckedIOException
instead ofIOException
.static boolean
isSameFile(java.nio.file.Path path, java.nio.file.Path path2)
Delegates toFiles.isSameFile(Path, Path)
throwingUncheckedIOException
instead ofIOException
.static java.util.stream.Stream<java.lang.String>
lines(java.nio.file.Path path)
Delegates toFiles.lines(Path)
throwingUncheckedIOException
instead ofIOException
.static java.util.stream.Stream<java.lang.String>
lines(java.nio.file.Path path, java.nio.charset.Charset cs)
Delegates toFiles.lines(Path, Charset)
throwingUncheckedIOException
instead ofIOException
.static java.util.stream.Stream<java.nio.file.Path>
list(java.nio.file.Path dir)
Delegates toFiles.list(Path)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
move(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)
Delegates toFiles.move(Path, Path, CopyOption...)
throwingUncheckedIOException
instead ofIOException
.static java.io.BufferedReader
newBufferedReader(java.nio.file.Path path)
Delegates toFiles.newBufferedReader(Path)
throwingUncheckedIOException
instead ofIOException
.static java.io.BufferedReader
newBufferedReader(java.nio.file.Path path, java.nio.charset.Charset cs)
Delegates toFiles.newBufferedReader(Path, Charset)
throwingUncheckedIOException
instead ofIOException
.static java.io.BufferedWriter
newBufferedWriter(java.nio.file.Path path, java.nio.charset.Charset cs, java.nio.file.OpenOption... options)
Delegates toFiles.newBufferedWriter(Path, Charset, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.static java.io.BufferedWriter
newBufferedWriter(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newBufferedWriter(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.channels.SeekableByteChannel
newByteChannel(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newByteChannel(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.newByteChannel(Path, Set, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.DirectoryStream<java.nio.file.Path>
newDirectoryStream(java.nio.file.Path dir)
Delegates toFiles.newDirectoryStream(Path)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.DirectoryStream<java.nio.file.Path>
newDirectoryStream(java.nio.file.Path dir, java.lang.String glob)
Delegates toFiles.newDirectoryStream(Path, String)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.newDirectoryStream(Path, java.nio.file.DirectoryStream.Filter)
throwingUncheckedIOException
instead ofIOException
.static java.io.InputStream
newInputStream(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newInputStream(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.static java.io.OutputStream
newOutputStream(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newOutputStream(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.static java.lang.String
probeContentType(java.nio.file.Path path)
Delegates toFiles.probeContentType(Path)
throwingUncheckedIOException
instead ofIOException
.static byte[]
readAllBytes(java.nio.file.Path path)
Delegates toFiles.readAllBytes(Path)
throwingUncheckedIOException
instead ofIOException
.static java.util.List<java.lang.String>
readAllLines(java.nio.file.Path path)
Delegates toFiles.readAllLines(Path)
throwingUncheckedIOException
instead ofIOException
.static java.util.List<java.lang.String>
readAllLines(java.nio.file.Path path, java.nio.charset.Charset cs)
Delegates toFiles.readAllLines(Path, Charset)
throwingUncheckedIOException
instead ofIOException
.static <A extends java.nio.file.attribute.BasicFileAttributes>
AreadAttributes(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options)
Delegates toFiles.readAttributes(Path, Class, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.readAttributes(Path, String, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
readSymbolicLink(java.nio.file.Path link)
Delegates toFiles.readSymbolicLink(Path)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.setAttribute(Path, String, Object, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
setLastModifiedTime(java.nio.file.Path path, java.nio.file.attribute.FileTime time)
Delegates toFiles.setLastModifiedTime(Path, FileTime)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
setOwner(java.nio.file.Path path, java.nio.file.attribute.UserPrincipal owner)
Delegates toFiles.setOwner(Path, UserPrincipal)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
setPosixFilePermissions(java.nio.file.Path path, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
Delegates toFiles.setPosixFilePermissions(Path, Set)
throwingUncheckedIOException
instead ofIOException
.static long
size(java.nio.file.Path path)
Delegates toFiles.size(Path)
throwingUncheckedIOException
instead ofIOException
.static java.util.stream.Stream<java.nio.file.Path>
walk(java.nio.file.Path start, int maxDepth, java.nio.file.FileVisitOption... options)
Delegates toFiles.walk(Path, int, FileVisitOption...)
throwingUncheckedIOException
instead ofIOException
.static java.util.stream.Stream<java.nio.file.Path>
walk(java.nio.file.Path start, java.nio.file.FileVisitOption... options)
Delegates toFiles.walk(Path, FileVisitOption...)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
walkFileTree(java.nio.file.Path start, java.nio.file.FileVisitor<? super java.nio.file.Path> visitor)
Delegates toFiles.walkFileTree(Path, FileVisitor)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.walkFileTree(Path, Set, int, FileVisitor)
throwingUncheckedIOException
instead ofIOException
.static java.nio.file.Path
write(java.nio.file.Path path, byte[] bytes, java.nio.file.OpenOption... options)
Delegates toFiles.write(Path, byte[], OpenOption...)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.write(Path, Iterable, Charset, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.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 toFiles.write(Path, Iterable, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.
-
-
-
Method Detail
-
copy
public static long copy(java.io.InputStream in, java.nio.file.Path target, java.nio.file.CopyOption... options)
Delegates toFiles.copy(InputStream, Path, CopyOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
in
- See delegate.target
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.- See Also:
Files.copy(InputStream, Path,CopyOption...)
-
copy
public static long copy(java.nio.file.Path source, java.io.OutputStream out)
Delegates toFiles.copy(Path, OutputStream)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
source
- See delegate. See delegate.out
- See delegate. See delegate.- Returns:
- See delegate. See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
copy
public static java.nio.file.Path copy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)
Delegates toFiles.copy(Path, Path, CopyOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
source
- See delegate.target
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createDirectories
public static java.nio.file.Path createDirectories(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createDirectories(Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
dir
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createDirectory
public static java.nio.file.Path createDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createDirectory(Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
dir
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createFile
public static java.nio.file.Path createFile(java.nio.file.Path path, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createFile(Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createLink
public static java.nio.file.Path createLink(java.nio.file.Path link, java.nio.file.Path existing)
Delegates toFiles.createLink(Path, Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
link
- See delegate.existing
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createSymbolicLink
public static java.nio.file.Path createSymbolicLink(java.nio.file.Path link, java.nio.file.Path target, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createSymbolicLink(Path, Path, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
link
- See delegate.target
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createTempDirectory
public static java.nio.file.Path createTempDirectory(java.nio.file.Path dir, java.lang.String prefix, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createTempDirectory(Path, String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
dir
- See delegate.prefix
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createTempDirectory
public static java.nio.file.Path createTempDirectory(java.lang.String prefix, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createTempDirectory(String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
prefix
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createTempFile
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)
Delegates toFiles.createTempFile(Path, String, String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
dir
- See delegate.prefix
- See delegate.suffix
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
createTempFile
public static java.nio.file.Path createTempFile(java.lang.String prefix, java.lang.String suffix, java.nio.file.attribute.FileAttribute<?>... attrs)
Delegates toFiles.createTempFile(String, String, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
prefix
- See delegate.suffix
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
delete
public static void delete(java.nio.file.Path path)
Delegates toFiles.delete(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
deleteIfExists
public static boolean deleteIfExists(java.nio.file.Path path)
Delegates toFiles.deleteIfExists(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
find
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)
Delegates toFiles.find(Path, int, BiPredicate, FileVisitOption...)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
wraps aDirectoryStream
. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed.- Parameters:
start
- See delegate.maxDepth
- See delegate.matcher
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.- Since:
- 2.14.0
-
getAttribute
public static java.lang.Object getAttribute(java.nio.file.Path path, java.lang.String attribute, java.nio.file.LinkOption... options)
Delegates toFiles.getAttribute(Path, String, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.attribute
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
getFileStore
public static java.nio.file.FileStore getFileStore(java.nio.file.Path path)
Delegates toFiles.getFileStore(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
getLastModifiedTime
public static java.nio.file.attribute.FileTime getLastModifiedTime(java.nio.file.Path path, java.nio.file.LinkOption... options)
Delegates toFiles.getLastModifiedTime(Path, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
getOwner
public static java.nio.file.attribute.UserPrincipal getOwner(java.nio.file.Path path, java.nio.file.LinkOption... options)
Delegates toFiles.getOwner(Path, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
getPosixFilePermissions
public static java.util.Set<java.nio.file.attribute.PosixFilePermission> getPosixFilePermissions(java.nio.file.Path path, java.nio.file.LinkOption... options)
Delegates toFiles.getPosixFilePermissions(Path, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
isHidden
public static boolean isHidden(java.nio.file.Path path)
Delegates toFiles.isHidden(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
isSameFile
public static boolean isSameFile(java.nio.file.Path path, java.nio.file.Path path2)
Delegates toFiles.isSameFile(Path, Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.path2
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
lines
public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path path)
Delegates toFiles.lines(Path)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
wraps aReader
. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed.- Parameters:
path
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
lines
public static java.util.stream.Stream<java.lang.String> lines(java.nio.file.Path path, java.nio.charset.Charset cs)
Delegates toFiles.lines(Path, Charset)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
wraps aReader
. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed.- Parameters:
path
- See delegate.cs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
list
public static java.util.stream.Stream<java.nio.file.Path> list(java.nio.file.Path dir)
Delegates toFiles.list(Path)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
wraps aDirectoryStream
. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed.- Parameters:
dir
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
move
public static java.nio.file.Path move(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)
Delegates toFiles.move(Path, Path, CopyOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
source
- See delegate.target
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newBufferedReader
public static java.io.BufferedReader newBufferedReader(java.nio.file.Path path)
Delegates toFiles.newBufferedReader(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newBufferedReader
public static java.io.BufferedReader newBufferedReader(java.nio.file.Path path, java.nio.charset.Charset cs)
Delegates toFiles.newBufferedReader(Path, Charset)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.cs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newBufferedWriter
public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path path, java.nio.charset.Charset cs, java.nio.file.OpenOption... options)
Delegates toFiles.newBufferedWriter(Path, Charset, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.cs
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newBufferedWriter
public static java.io.BufferedWriter newBufferedWriter(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newBufferedWriter(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newByteChannel
public static java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newByteChannel(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newByteChannel
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)
Delegates toFiles.newByteChannel(Path, Set, FileAttribute...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.attrs
- See delegate.- Returns:
- See delegate.
- Throws:
java.io.UncheckedIOException
- Wraps anIOException
.
-
newDirectoryStream
public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir)
Delegates toFiles.newDirectoryStream(Path)
throwingUncheckedIOException
instead ofIOException
.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.- Parameters:
dir
- See delegate.- Returns:
- See delegate.
-
newDirectoryStream
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)
Delegates toFiles.newDirectoryStream(Path, java.nio.file.DirectoryStream.Filter)
throwingUncheckedIOException
instead ofIOException
.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.- Parameters:
dir
- See delegate.filter
- See delegate.- Returns:
- See delegate.
-
newDirectoryStream
public static java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir, java.lang.String glob)
Delegates toFiles.newDirectoryStream(Path, String)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
wraps aDirectoryStream
. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed.- Parameters:
dir
- See delegate.glob
- See delegate.- Returns:
- See delegate.
-
newInputStream
public static java.io.InputStream newInputStream(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newInputStream(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
newOutputStream
public static java.io.OutputStream newOutputStream(java.nio.file.Path path, java.nio.file.OpenOption... options)
Delegates toFiles.newOutputStream(Path, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
probeContentType
public static java.lang.String probeContentType(java.nio.file.Path path)
Delegates toFiles.probeContentType(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
-
readAllBytes
public static byte[] readAllBytes(java.nio.file.Path path)
Delegates toFiles.readAllBytes(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
-
readAllLines
public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path path)
Delegates toFiles.readAllLines(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
-
readAllLines
public static java.util.List<java.lang.String> readAllLines(java.nio.file.Path path, java.nio.charset.Charset cs)
Delegates toFiles.readAllLines(Path, Charset)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.cs
- See delegate.- Returns:
- See delegate.
-
readAttributes
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)
Delegates toFiles.readAttributes(Path, Class, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Type Parameters:
A
- See delegate.- Parameters:
path
- See delegate.type
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
readAttributes
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)
Delegates toFiles.readAttributes(Path, String, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.attributes
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
readSymbolicLink
public static java.nio.file.Path readSymbolicLink(java.nio.file.Path link)
Delegates toFiles.readSymbolicLink(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
link
- See delegate.- Returns:
- See delegate.
-
setAttribute
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)
Delegates toFiles.setAttribute(Path, String, Object, LinkOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.attribute
- See delegate.value
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
setLastModifiedTime
public static java.nio.file.Path setLastModifiedTime(java.nio.file.Path path, java.nio.file.attribute.FileTime time)
Delegates toFiles.setLastModifiedTime(Path, FileTime)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.time
- See delegate.- Returns:
- See delegate.
-
setOwner
public static java.nio.file.Path setOwner(java.nio.file.Path path, java.nio.file.attribute.UserPrincipal owner)
Delegates toFiles.setOwner(Path, UserPrincipal)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.owner
- See delegate.- Returns:
- See delegate.
-
setPosixFilePermissions
public static java.nio.file.Path setPosixFilePermissions(java.nio.file.Path path, java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
Delegates toFiles.setPosixFilePermissions(Path, Set)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.perms
- See delegate.- Returns:
- See delegate.
-
size
public static long size(java.nio.file.Path path)
Delegates toFiles.size(Path)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.- Returns:
- See delegate.
-
walk
public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path start, java.nio.file.FileVisitOption... options)
Delegates toFiles.walk(Path, FileVisitOption...)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
may wrap one or moreDirectoryStream
s. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed. Calling a closed stream causes aIllegalStateException
.- Parameters:
start
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
walk
public static java.util.stream.Stream<java.nio.file.Path> walk(java.nio.file.Path start, int maxDepth, java.nio.file.FileVisitOption... options)
Delegates toFiles.walk(Path, int, FileVisitOption...)
throwingUncheckedIOException
instead ofIOException
.The returned
Stream
may wrap one or moreDirectoryStream
s. When you require timely disposal of file system resources, use atry
-with-resources block to ensure invocation of the stream'sBaseStream.close()
method after the stream operations are completed. Calling a closed stream causes aIllegalStateException
.- Parameters:
start
- See delegate.maxDepth
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
walkFileTree
public static java.nio.file.Path walkFileTree(java.nio.file.Path start, java.nio.file.FileVisitor<? super java.nio.file.Path> visitor)
Delegates toFiles.walkFileTree(Path, FileVisitor)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
start
- See delegate.visitor
- See delegate.- Returns:
- See delegate.
-
walkFileTree
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)
Delegates toFiles.walkFileTree(Path, Set, int, FileVisitor)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
start
- See delegate.options
- See delegate.maxDepth
- See delegate.visitor
- See delegate.- Returns:
- See delegate.
-
write
public static java.nio.file.Path write(java.nio.file.Path path, byte[] bytes, java.nio.file.OpenOption... options)
Delegates toFiles.write(Path, byte[], OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.bytes
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
write
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)
Delegates toFiles.write(Path, Iterable, Charset, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.lines
- See delegate.cs
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
write
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)
Delegates toFiles.write(Path, Iterable, OpenOption...)
throwingUncheckedIOException
instead ofIOException
.- Parameters:
path
- See delegate.lines
- See delegate.options
- See delegate.- Returns:
- See delegate.
-
-