|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface ResolvedPath
A façade for operating on a pathname in a file system for which is not known if it is a directory, a file or if it does not exist.
Instances of this interface are usually obtained from the
PathNameResolver.resolve(String, String...) method hence the name
resolved path.
| Method Summary | ||
|---|---|---|
|
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 object. |
|
String |
getPath()
Returns the full path of this object. |
|
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. |
|
| Methods inherited from interface br.com.objectos.fs.WritablePathName |
|---|
openOutputStream, openWriteChannel, openWriter |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface br.com.objectos.core.object.ToStringObject |
|---|
formatToString |
| Method Detail |
|---|
Directory 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 occurs
ResolvedPath createParents()
throws IOException
IOException - if an I/O error occurs
RegularFile createRegularFile(RegularFileCreateOption... options)
throws FoundException,
IOException
Nonexistent parent directories are not created by this method, use
createParents() if necessary.
options - the file creation options
FoundException - if this pathname exists (even if it is a regular file)
IOException - if an I/O error occurs
Directory toDirectory()
throws NotFoundException,
NotDirectoryException,
IOException
NotFoundException - if this pathname does not exist
NotDirectoryException - if this pathname exists but it is not a directory (it is a regular
file for instance)
IOException - if an I/O error occurs
Directory 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 occurs
RegularFile toRegularFile()
throws NotFoundException,
NotRegularFileException,
IOException
NotFoundException - if this pathname does not exist
NotRegularFileException - 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 visitor
IOException - 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 pathnameURI toUri()
URI representation of this pathname.
URI representation of this pathname
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||