public interface File extends DirectoryEntry
Directory
Modifier and Type | Method and Description |
---|---|
void |
appendContents(byte[] data)
Append the data to the file.
|
void |
copy(File from)
Asks for the argument file to be copied to this one.
|
byte[] |
getContents(int offset,
int length) |
long |
getSize() |
void |
setContents(byte[] data)
Write the data to the file, totally replacing what was there before.
|
destroy, getFullName, getModificationDate, getName
compareTo
byte[] getContents(int offset, int length) throws FilesystemAccessException
offset
- Where in the file to start reading.length
- The length of file to read, or -1 to read to the end of the
file.FilesystemAccessException
- If the read of the file goes wrong.void setContents(byte[] data) throws FilesystemAccessException
data
- The literal bytes that will form the new contents of the file.FilesystemAccessException
- If the write to the file goes wrong.void appendContents(byte[] data) throws FilesystemAccessException
data
- The literal bytes that will be added on to the end of the
file.FilesystemAccessException
- If the write to the file goes wrong.long getSize() throws FilesystemAccessException
FilesystemAccessException
- If the read of the file size goes wrong.void copy(File from) throws FilesystemAccessException
from
- The source file.FilesystemAccessException
- If anything goes wrong.Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.