Spec-Zone .ru
спецификации, руководства, описания, API
Please note that the specifications and other information contained herein are not final and are subject to change. The information is being made available to you solely for purpose of evaluation.

Java™ Platform
Standard Ed. 7

DRAFT ea-b118

Uses of Class
java.nio.file.Path

Packages that use Path
Package Description
java.io Provides for system input and output through data streams, serialization and the file system. 
java.nio.channels Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations. 
java.nio.file Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems. 
java.nio.file.spi Service-provider classes for the java.nio.file package. 
 

Uses of Path in java.io
 

Methods in java.io that return Path
Modifier and Type Method and Description
 Path File.toPath()
          Returns a java.nio.file.Path object constructed from the this abstract path.
 

Uses of Path in java.nio.channels
 

Methods in java.nio.channels with parameters of type Path
Modifier and Type Method and Description
static AsynchronousFileChannel AsynchronousFileChannel.open(Path file, OpenOption... options)
          Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.
static FileChannel FileChannel.open(Path file, OpenOption... options)
          Opens or creates a file, returning a file channel to access the file.
static AsynchronousFileChannel AsynchronousFileChannel.open(Path file, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)
          Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.
static FileChannel FileChannel.open(Path file, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
          Opens or creates a file, returning a file channel to access the file.
 

Uses of Path in java.nio.file
 

Fields in java.nio.file with type parameters of type Path
Modifier and Type Field and Description
static WatchEvent.Kind<Path> StandardWatchEventKind.ENTRY_CREATE
          Directory entry created.
static WatchEvent.Kind<Path> StandardWatchEventKind.ENTRY_DELETE
          Directory entry deleted.
static WatchEvent.Kind<Path> StandardWatchEventKind.ENTRY_MODIFY
          Directory entry modified.
 

Methods in java.nio.file that return Path
Modifier and Type Method and Description
abstract  Path Path.copyTo(Path target, CopyOption... options)
          Copy the file located by this path to a target location.
abstract  Path Path.createDirectory(FileAttribute<?>... attrs)
          Creates a new directory.
abstract  Path Path.createFile(FileAttribute<?>... attrs)
          Creates a new and empty file, failing if the file already exists.
abstract  Path Path.createLink(Path existing)
          Creates a new link (directory entry) for an existing file (optional operation).
abstract  Path Path.createSymbolicLink(Path target, FileAttribute<?>... attrs)
          Creates a symbolic link to a target (optional operation).
static Path Paths.get(String path)
          Constructs a Path by converting the given path string.
static Path Paths.get(URI uri)
          Converts the given URI to a Path object.
abstract  Path Path.getName()
          Returns the name of the file or directory denoted by this path.
abstract  Path Path.getName(int index)
          Returns a name element of this path.
abstract  Path Path.getParent()
          Returns the parent path, or null if this path does not have a parent.
abstract  Path FileSystem.getPath(String path)
          Converts a path string to a Path.
abstract  Path Path.getRoot()
          Returns the root component of this path as a Path object, or null if this path does not have a root component.
abstract  Path Path.moveTo(Path target, CopyOption... options)
          Move or rename the file located by this path to a target location.
abstract  Path Path.normalize()
          Returns a path that is this path with redundant name elements eliminated.
abstract  Path Path.readSymbolicLink()
          Reads the target of a symbolic link (optional operation).
abstract  Path Path.relativize(Path other)
          Constructs a relative path between this path and a given path.
abstract  Path Path.resolve(Path other)
          Resolve the given path against this path.
abstract  Path Path.resolve(String other)
          Converts a given path string to a Path and resolves it against this Path in exactly the manner specified by the resolve method.
abstract  Path Path.subpath(int beginIndex, int endIndex)
          Returns a relative Path that is a subsequence of the name elements of this path.
abstract  Path Path.toAbsolutePath()
          Returns a Path object representing the absolute path of this path.
abstract  Path Path.toRealPath(boolean resolveLinks)
          Returns the real path of an existing file.
 

Methods in java.nio.file that return types with arguments of type Path
Modifier and Type Method and Description
abstract  Iterable<Path> FileSystem.getRootDirectories()
          Returns an object to iterate over the paths of the root directories.
abstract  Iterator<Path> Path.iterator()
          Returns an iterator over the name elements of this path.
abstract  DirectoryStream<Path> Path.newDirectoryStream()
          Opens the directory referenced by this object, returning a DirectoryStream to iterate over all entries in the directory.
abstract  DirectoryStream<Path> Path.newDirectoryStream(DirectoryStream.Filter<? super Path> filter)
          Opens the directory referenced by this object, returning a DirectoryStream to iterate over the entries in the directory.
abstract  DirectoryStream<Path> Path.newDirectoryStream(String glob)
          Opens the directory referenced by this object, returning a DirectoryStream to iterate over the entries in the directory.
 

Methods in java.nio.file with parameters of type Path
Modifier and Type Method and Description
abstract  int Path.compareTo(Path other)
          Compares two abstract paths lexicographically.
abstract  Path Path.copyTo(Path target, CopyOption... options)
          Copy the file located by this path to a target location.
static void Files.createDirectories(Path dir, FileAttribute<?>... attrs)
          Creates a directory by creating all nonexistent parent directories first.
abstract  Path Path.createLink(Path existing)
          Creates a new link (directory entry) for an existing file (optional operation).
abstract  Path Path.createSymbolicLink(Path target, FileAttribute<?>... attrs)
          Creates a symbolic link to a target (optional operation).
abstract  boolean Path.endsWith(Path other)
          Tests if this path ends with the given path.
abstract  boolean Path.isSameFile(Path other)
          Tests if the file referenced by this object is the same file referenced by another object.
 boolean PathMatcher.matches(Path path)
          Tells if given path matches this matcher's pattern.
abstract  Path Path.moveTo(Path target, CopyOption... options)
          Move or rename the file located by this path to a target location.
abstract  Path Path.relativize(Path other)
          Constructs a relative path between this path and a given path.
abstract  Path Path.resolve(Path other)
          Resolve the given path against this path.
abstract  boolean Path.startsWith(Path other)
          Tests if this path starts with the given path.
static void Files.walkFileTree(Path start, FileVisitor<? super Path> visitor)
          Walks a file tree.
static void Files.walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)
          Walks a file tree.
 

Method parameters in java.nio.file with type arguments of type Path
Modifier and Type Method and Description
abstract  DirectoryStream<Path> Path.newDirectoryStream(DirectoryStream.Filter<? super Path> filter)
          Opens the directory referenced by this object, returning a DirectoryStream to iterate over the entries in the directory.
static void Files.walkFileTree(Path start, FileVisitor<? super Path> visitor)
          Walks a file tree.
static void Files.walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)
          Walks a file tree.
 

Uses of Path in java.nio.file.spi
 

Methods in java.nio.file.spi that return Path
Modifier and Type Method and Description
abstract  Path FileSystemProvider.getPath(URI uri)
          Return a Path object by converting the given URI.
 

Methods in java.nio.file.spi with parameters of type Path
Modifier and Type Method and Description
 AsynchronousFileChannel FileSystemProvider.newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)
          Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.
 FileChannel FileSystemProvider.newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
          Opens or creates a file for reading and/or writing, returning a file channel to access the file.
 


Java™ Platform
Standard Ed. 7

DRAFT ea-b118

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 1993, 2010, Oracle Corporation. All rights reserved.
DRAFT ea-b118

Scripting on this page tracks web page traffic, but does not change the content in any way.