All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.nio.file.Files Maven / Gradle / Ivy

package java.nio.file;

import java.io.*;
import java.nio.channels.SeekableByteChannel;
import java.nio.charset.Charset;
import java.nio.file.attribute.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.BiPredicate;
import java.util.stream.Stream;

public final class Files {
	native public static InputStream newInputStream(Path path, OpenOption... options) throws IOException;

	native public static OutputStream newOutputStream(Path path, OpenOption... options) throws IOException;

	native public static SeekableByteChannel newByteChannel(Path path, Set options, FileAttribute... attrs) throws IOException;

	native public static SeekableByteChannel newByteChannel(Path path, OpenOption... options) throws IOException;

	native public static DirectoryStream newDirectoryStream(Path dir) throws IOException;

	native public static DirectoryStream newDirectoryStream(Path dir, String glob) throws IOException;

	native public static DirectoryStream newDirectoryStream(Path dir, DirectoryStream.Filter filter) throws IOException;

	native public static Path createFile(Path path, FileAttribute... attrs) throws IOException;

	native public static Path createDirectory(Path dir, FileAttribute... attrs) throws IOException;

	native public static Path createDirectories(Path dir, FileAttribute... attrs) throws IOException;

	native public static Path createTempFile(Path dir, String prefix, String suffix, FileAttribute... attrs) throws IOException;

	native public static Path createTempFile(String prefix, String suffix, FileAttribute... attrs) throws IOException;

	native public static Path createTempDirectory(Path dir, String prefix, FileAttribute... attrs) throws IOException;

	native public static Path createTempDirectory(String prefix, FileAttribute... attrs) throws IOException;

	native public static Path createSymbolicLink(Path link, Path target, FileAttribute... attrs) throws IOException;

	native public static Path createLink(Path link, Path existing) throws IOException;

	native public static void delete(Path path) throws IOException;

	native public static boolean deleteIfExists(Path path) throws IOException;

	native public static Path copy(Path source, Path target, CopyOption... options) throws IOException;

	native public static Path move(Path source, Path target, CopyOption... options) throws IOException;

	native public static Path readSymbolicLink(Path link) throws IOException;

	native public static FileStore getFileStore(Path path) throws IOException;

	native public static boolean isSameFile(Path path, Path path2) throws IOException;

	native public static boolean isHidden(Path path) throws IOException;

	native public static String probeContentType(Path path) throws IOException;

	native public static  V getFileAttributeView(Path path, Class type, LinkOption... options);

	native public static  A readAttributes(Path path, Class type, LinkOption... options) throws IOException;

	native public static Path setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException;

	native public static Object getAttribute(Path path, String attribute, LinkOption... options) throws IOException;

	native public static Map readAttributes(Path path, String attributes, LinkOption... options) throws IOException;

	native public static Set getPosixFilePermissions(Path path, LinkOption... options) throws IOException;

	native public static Path setPosixFilePermissions(Path path, Set perms) throws IOException;

	native public static UserPrincipal getOwner(Path path, LinkOption... options) throws IOException;

	native public static Path setOwner(Path path, UserPrincipal owner) throws IOException;

	native public static boolean isSymbolicLink(Path path);

	native public static boolean isDirectory(Path path, LinkOption... options);

	native public static boolean isRegularFile(Path path, LinkOption... options);

	native public static FileTime getLastModifiedTime(Path path, LinkOption... options) throws IOException;

	native public static Path setLastModifiedTime(Path path, FileTime time) throws IOException;

	native public static long size(Path path) throws IOException;

	native public static boolean exists(Path path, LinkOption... options);

	native public static boolean notExists(Path path, LinkOption... options);

	native public static boolean isReadable(Path path);

	native public static boolean isWritable(Path path);

	native public static boolean isExecutable(Path path);

	native public static Path walkFileTree(Path start, Set options, int maxDepth, FileVisitor visitor) throws IOException;

	native public static Path walkFileTree(Path start, FileVisitor visitor) throws IOException;

	native public static BufferedReader newBufferedReader(Path path, Charset cs) throws IOException;

	native public static BufferedReader newBufferedReader(Path path) throws IOException;

	native public static BufferedWriter newBufferedWriter(Path path, Charset cs, OpenOption... options) throws IOException;

	native public static BufferedWriter newBufferedWriter(Path path, OpenOption... options) throws IOException;

	native public static long copy(InputStream in, Path target, CopyOption... options) throws IOException;

	native public static long copy(Path source, OutputStream out) throws IOException;

	native public static byte[] readAllBytes(Path path) throws IOException;

	native public static List readAllLines(Path path, Charset cs) throws IOException;

	native public static List readAllLines(Path path) throws IOException;

	native public static Path write(Path path, byte[] bytes, OpenOption... options) throws IOException;

	native public static Path write(Path path, Iterable lines, Charset cs, OpenOption... options) throws IOException;

	native public static Path write(Path path, Iterable lines, OpenOption... options) throws IOException;

	native public static Stream list(Path dir) throws IOException;

	native public static Stream walk(Path start, int maxDepth, FileVisitOption... options) throws IOException;

	native public static Stream walk(Path start, FileVisitOption... options) throws IOException;

	native public static Stream find(Path start, int maxDepth, BiPredicate matcher, FileVisitOption... options) throws IOException;

	native public static Stream lines(Path path, Charset cs) throws IOException;

	native public static Stream lines(Path path) throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy