|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface WritablePathName
A façade for writing operations. Instances of this interface may represent an existing file or the pathname of a file that will be created.
This interface can be used as the destination in methods from the
Copy and Write classes.
Copy,
Write| Method Summary | ||
|---|---|---|
|
acceptPathNameVisitor(PathNameVisitor<R,P> visitor,
P p)
Accept method used to implement the visitor pattern. |
|
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. |
|
OutputStream |
openOutputStream()
Returns a new output stream for writing to this pathname. |
|
FileChannel |
openWriteChannel()
Returns a new channel for writing to this pathname. |
|
Writer |
openWriter(Charset charset)
Returns a new writer for writing characters to this pathname. |
|
File |
toFile()
Returns a File representation of this pathname. |
|
URI |
toUri()
Returns an URI representation of this pathname. |
|
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface br.com.objectos.core.object.ToStringObject |
|---|
formatToString |
| Method Detail |
|---|
OutputStream openOutputStream()
throws IOException
The file is created if it does not exist. If the file exists then the returned output stream will be in append mode.
openOutputStream in interface OutputStreamSourceIOException - if an I/O error occurs
FileChannel openWriteChannel()
throws IOException
The returned channel is open in write-only mode. The file is created if it does not exist. If the file exists then the returned channel's initial position is the file size.
IOException - if an I/O error occurs
Writer openWriter(Charset charset)
throws IOException
The file is created if it does not exist. If the file exists then the returned writer will be in append mode.
openWriter in interface WriterSourcecharset - the charset to use for encoding
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 | |||||||