|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.marringtons.file.Output
Helper class for file output - find output files in the directory system, return absolute paths, make unique file and retrieve output streams or writers.
| Field Summary | |
static String |
basePath
Directory to write files to (if not absolute). |
| Method Summary | |
static File |
getFile(String name)
Return a file object for an output file. |
static String |
makeAbsolute(String name)
Return an absolute path to a file for output - either from the original name or in the output directory. |
static String |
makeUnique(String name,
String type)
Create a unique file name - easily read to include date and time. |
static void |
set(String dir)
Set the output directory - normally from the application name. |
static OutputStream |
stream(String name,
boolean append)
Given a file name, create or append to a file. |
static Writer |
writer(String name,
boolean append)
Given a file name, create or append to a file. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static String basePath
| Method Detail |
public static void set(String dir)
dir - directory to use to files being created.
public static OutputStream stream(String name,
boolean append)
throws FileNotFoundException
name - of fileappend - true to add to file, false to create new file (or clear old)
FileNotFoundException
public static Writer writer(String name,
boolean append)
throws IOException
name - of fileappend - true to add to file, false to create new file (or clear old)
IOExceptionpublic static String makeAbsolute(String name)
name - to be turned into an absolute path
public static String makeUnique(String name,
String type)
name - to describe the filetype - file type (extension - as in txt).
public static File getFile(String name)
name - of file to build File object instance for.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||