|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface RegularFile
A façade for regular file only operations.
This is only a façade. More specifically, the underlying object may or may not represent an actual regular file. For example, the file may have been deleted between the time an instance of this interface is obtained and the time a method in this interface is invoked.
This interface can be used as both the source and destination in methods from
the Copy, Read and Write classes.
Copy,
Read,
Write| Method Summary | ||
|---|---|---|
|
acceptPathNameVisitor(PathNameVisitor<R,P> visitor,
P p)
Accept method used to implement the visitor pattern. |
|
void |
delete()
Deletes this file. |
|
boolean |
exists()
Returns true if the pathname represented by this object exists. |
|
long |
getLastModifiedMillis()
Returns the last modification time in millis. |
|
String |
getName()
Returns the name of this file. |
|
Directory |
getParent()
Returns the parent of this object. |
|
String |
getPath()
Returns the full path of this object. |
|
boolean |
is(RegularFileIsOption attribute)
Tests if this file has the specified attribute. |
|
InputStream |
openInputStream()
Returns a new input stream for reading from this file. |
|
OutputStream |
openOutputStream()
Returns a new output stream, in append mode, for writing to this file. |
|
FileChannel |
openReadAndWriteChannel()
Returns a new channel for reading from and writing to this file. |
|
FileChannel |
openReadChannel()
Returns a new channel for reading from this file. |
|
long |
size()
Returns the file size in number of bytes. |
|
File |
toFile()
Returns a File representation of this file. |
|
URI |
toUri()
Returns an URI representation of this pathname. |
|
void |
truncate()
Truncates this file. |
|
| Methods inherited from interface br.com.objectos.core.io.ReaderSource |
|---|
openReader |
| Methods inherited from interface br.com.objectos.fs.WritablePathName |
|---|
openWriteChannel, openWriter |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface br.com.objectos.core.object.ToStringObject |
|---|
formatToString |
| Method Detail |
|---|
void delete()
throws IOException
IOException - if an I/O error occurs
long getLastModifiedMillis()
throws IOException
IOException - if an I/O error occursString getName()
Directory getParent()
throws NotFoundException
If this object represents a nonexistent pathname then its parent might also be nonexistent.
NotFoundException - if a parent for this object cannot be found
boolean is(RegularFileIsOption attribute)
throws IOException
attribute - the attribute to check for
true if this file has the specified attribute
IOException - if an I/O error occurs
InputStream openInputStream()
throws IOException
openInputStream in interface InputStreamSourceIOException - if an I/O error occurs
OutputStream openOutputStream()
throws IOException
openOutputStream in interface OutputStreamSourceopenOutputStream in interface WritablePathNameIOException - if an I/O error occurstruncate()
FileChannel openReadAndWriteChannel()
throws IOException
The returned channel is open in read and write mode and its initial
position is 0L.
0L
IOException - if an I/O error occurs
FileChannel openReadChannel()
throws IOException
The returned channel is open in read-only mode and its initial position is
0L.
0L
IOException - if an I/O error occurs
long size()
throws IOException
IOException - if an I/O error occursFile toFile()
File representation of this file.
File representation of this file
void truncate()
throws IOException
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 getPath()
URI 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 | |||||||