All Packages Class Hierarchy This Package Previous Next Index
Class vnr.io.XFile
java.lang.Object
|
+----java.io.File
|
+----vnr.io.XFile
- public class XFile
- extends File
XFile - an xtended file class (and I always wanted to use it in code :) )
adds IO related methods for ease of use
1997-11-20 dlg Created
-
DEFAULT_BUFFER_SIZE
-
-
XFile()
- add a constructor of my own: Creates a file to represent "."
for 'beaning' purposes
-
XFile(File, String)
- Replicate parent constructors
path and name
-
XFile(String)
- Just name
-
XFile(String, String)
- path and name are strings
-
getContents()
-
-
getReader()
-
-
getText()
- get file contents back as a string
-
getWriter()
-
-
getWriter(boolean)
-
-
setContents(String[])
- write the array passed to the file
-
setContents(String[], boolean)
- write the array passed to the file, possibly appending
-
setText(String)
- set file contents without appending, i.e.
-
setText(String, boolean)
- set file contents from a string
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
XFile
public XFile(File path,
String name)
- Replicate parent constructors
path and name
XFile
public XFile(String path)
- Just name
XFile
public XFile(String path,
String name)
- path and name are strings
XFile
public XFile()
- add a constructor of my own: Creates a file to represent "."
for 'beaning' purposes
getReader
public BufferedReader getReader() throws IOException, FileNotFoundException
getWriter
public BufferedWriter getWriter(boolean append) throws IOException
getWriter
public BufferedWriter getWriter() throws IOException
getContents
public synchronized String[] getContents() throws IOException, FileNotFoundException
- Returns:
- the contents of the file as an array of strings
setContents
public void setContents(String contents[],
boolean append) throws IOException
- write the array passed to the file, possibly appending
setContents
public synchronized void setContents(String contents[]) throws IOException
- write the array passed to the file
getText
public String getText() throws IOException, FileNotFoundException
- get file contents back as a string
setText
public void setText(String text,
boolean append) throws IOException
- set file contents from a string
setText
public void setText(String text) throws IOException
- set file contents without appending, i.e. overwrite
All Packages Class Hierarchy This Package Previous Next Index