br.com.objectos.fs
public interface WritablePathName extends PathName, OutputStreamSource, WriterSource
| Modifier and Type | Method and Description |
|---|---|
<R,P> R |
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 pathname.
|
String |
getPath()
Returns the full path of this pathname.
|
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. |
compareToOutputStream 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 occursFileChannel 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 occursWriter 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 encodingIOException - 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.