public interface File
getFilePointer method and set by the seek method.| Modifier and Type | Method and Description |
|---|---|
SeekableInputStream |
getInputStream()
Opens a stream for reading data from the file
|
String |
getName()
Returns the name of the file
|
SeekableOutputStream |
getOutputStream()
Opens a stream for writing data to a file.
|
long |
getSizeInBytes()
Returns the total size of the file in bytes
|
long |
lastModifiedTime()
Reports the last accessed or modified time for the file.
|
long |
length()
Reports the length of the file.
|
void |
setLastModifiedTime(long time)
Sets the last modified time for the file.
|
void |
truncate()
Erases the contents of the file and sets its length to 0
|
long length()
throws IOException
IOException - if an I/O error occurslong lastModifiedTime()
throws IOException
IOException - if an I/O error occurs.void setLastModifiedTime(long time)
throws IOException
time - the time to setIOException - if an I/O error occurs.SeekableInputStream getInputStream() throws IOException
IOException - if an error occurs while processing the request.SeekableOutputStream getOutputStream() throws IOException
IOException - if an output stream is already open or if an I/O error occurs.void truncate()
throws IOException
IOException - if an I/O error occurs.long getSizeInBytes()
String getName()
Copyright © 2015–2024. All rights reserved.