br.com.objectos.fs
public interface ResolvedPath extends PathName, WritablePathName
Instances of this interface are usually obtained from the
PathNameResolver.resolve(String, String...) method hence the name
resolved path.
| Modifier and Type | Method and Description |
|---|---|
<R,P> R |
acceptPathNameVisitor(PathNameVisitor<R,P> visitor,
P p)
Accept method used to implement the visitor pattern.
|
Directory |
createDirectory()
Creates a directory whose pathname is given by this object or fails if the
pathname already exists.
|
ResolvedPath |
createParents()
Creates all nonexistent parent directories of this pathname.
|
RegularFile |
createRegularFile(RegularFileCreateOption... options)
Creates a new (regular) file whose pathname is given by this object with
the specified creation options or fails if the pathname already exists.
|
boolean |
exists()
Returns
true if the pathname represented by this object exists. |
String |
getName()
Returns the name of this pathname.
|
String |
getPath()
Returns the full path of this pathname.
|
Directory |
toDirectory()
Returns the directory denoted by this pathname; fails if the directory does
not exist or if the pathname is not a directory.
|
Directory |
toDirectoryCreateIfNotFound()
Returns the directory denoted by this pathname; creates a new directory if
it does not exist or fails if the pathname is not a directory.
|
File |
toFile()
Returns a
File representation of this pathname. |
RegularFile |
toRegularFile()
Returns the file denoted by this pathname; fails if the file does not exist
or if the pathname is not a regular file.
|
URI |
toUri()
Returns an
URI representation of this pathname. |
openOutputStream, openWriteChannel, openWritercompareToDirectory createDirectory() throws FoundException, IOException
Nonexistent parent directories are not created by this method, use
createParents() if necessary.
FoundException - if this pathname exists (even if it is a directory)IOException - if an I/O error occursResolvedPath createParents() throws IOException
IOException - if an I/O error occursRegularFile createRegularFile(RegularFileCreateOption... options) throws FoundException, IOException
Nonexistent parent directories are not created by this method, use
createParents() if necessary.
options - the file creation optionsFoundException - if this pathname exists (even if it is a regular file)IOException - if an I/O error occursDirectory toDirectory() throws NotFoundException, NotDirectoryException, IOException
NotFoundException - if this pathname does not existNotDirectoryException - if this pathname exists but it is not a directory (it is a regular
file for instance)IOException - if an I/O error occursDirectory toDirectoryCreateIfNotFound() throws NotDirectoryException, IOException
Nonexistent parent directories are not created by this method, use
createParents() if necessary.
NotDirectoryException - if this pathname exists but it is not a directory (it is a file for
instance)IOException - if an I/O error occursRegularFile toRegularFile() throws NotFoundException, NotRegularFileException, IOException
NotFoundException - if this pathname does not existNotRegularFileException - if this pathname exists but it is not a regular file (it is a
directory for instance)IOException - if an I/O error occurs<R,P> R acceptPathNameVisitor(PathNameVisitor<R,P> visitor, P p) throws IOException
R - the result type of this operationP - the type of the additional objectvisitor - the visitor operating on this PathName instancep - additional object passed to the visitorIOException - if an I/O error occursboolean exists()
true if the pathname represented by this object exists.true if the pathname represented by this object existsString getName()
String getPath()
File toFile()
File representation of this pathname.File representation of this pathnameCopyright © 2021–2022 Objectos Software LTDA. All rights reserved.