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


Variable Index

 o DEFAULT_BUFFER_SIZE

Constructor Index

 o XFile()
add a constructor of my own: Creates a file to represent "."
for 'beaning' purposes
 o XFile(File, String)
Replicate parent constructors path and name
 o XFile(String)
Just name
 o XFile(String, String)
path and name are strings

Method Index

 o getContents()
 o getReader()
 o getText()
get file contents back as a string
 o getWriter()
 o getWriter(boolean)
 o setContents(String[])
write the array passed to the file
 o setContents(String[], boolean)
write the array passed to the file, possibly appending
 o setText(String)
set file contents without appending, i.e.
 o setText(String, boolean)
set file contents from a string

Variables

 o DEFAULT_BUFFER_SIZE
 public static final int DEFAULT_BUFFER_SIZE

Constructors

 o XFile
 public XFile(File path,
              String name)
Replicate parent constructors path and name

 o XFile
 public XFile(String path)
Just name

 o XFile
 public XFile(String path,
              String name)
path and name are strings

 o XFile
 public XFile()
add a constructor of my own: Creates a file to represent "."
for 'beaning' purposes

Methods

 o getReader
 public BufferedReader getReader() throws IOException, FileNotFoundException
 o getWriter
 public BufferedWriter getWriter(boolean append) throws IOException
 o getWriter
 public BufferedWriter getWriter() throws IOException
 o getContents
 public synchronized String[] getContents() throws IOException, FileNotFoundException
Returns:
the contents of the file as an array of strings
 o setContents
 public void setContents(String contents[],
                         boolean append) throws IOException
write the array passed to the file, possibly appending

 o setContents
 public synchronized void setContents(String contents[]) throws IOException
write the array passed to the file

 o getText
 public String getText() throws IOException, FileNotFoundException
get file contents back as a string

 o setText
 public void setText(String text,
                     boolean append) throws IOException
set file contents from a string

 o 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