-
Field Summary
Fields
static final int
Open file in append mode.
static final int
static final int
-
Method Summary
void
boolean
boolean
Check if a physical file exists.
Get the base file object.
int
Get the mode (READ/WRITE/APPEND) this handle is operating for.
Returns the java.io.File Path to the underlying file.
Read characters from a file.
Read a line of data from a file.
void
void
-
Field Details
-
READ
static final int READ
Open file in read mode.
- See Also:
-
-
WRITE
static final int WRITE
Open file in write mode.
- See Also:
-
-
APPEND
static final int APPEND
Open file in append mode.
- See Also:
-
-
Method Details
-
read
Read characters from a file.
- Parameters:
characters - amount of characters to read
- Returns:
- data read from file
- Throws:
IOException - on access errors
-
readLine
Read a line of data from a file. Reads until a line feed is detected.
- Returns:
- single line of text
- Throws:
IOException - on access errors
-
getPath
Returns the java.io.File Path to the underlying file.
- Returns:
- Path of the file
- Throws:
IOException - on access errors
-
write
Write data to a file. Uses platform default encoding to write strings to the file.
- Parameters:
data - data to write
- Throws:
IOException - on write errors
-
write
Write data to a file.
- Parameters:
data - data to write
- Throws:
IOException - on write errors
-
exists
boolean exists()
Check if a physical file exists.
- Returns:
true when file exists
-
createFile
boolean createFile(boolean createHierarchy)
throws IOException
Create a file.
- Parameters:
createHierarchy - create parent folders if they do not exist
- Returns:
true on success
- Throws:
Exception - on creation errors
IOException
-
-
getFile
Get the base file object. Returns an
IFile or a
File instance.
- Returns:
- base file object
-
getMode
int getMode()
Get the mode (READ/WRITE/APPEND) this handle is operating for.
- Returns:
- file mode