|
Hilbert II - Version 0.01.09 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.qedeq.kernel.utility.IoUtility
A collection of useful static methods for input and output.
| Method Summary | |
static void |
copyFile(File from,
File to)
Copies a file to a different location. |
static void |
createNecessaryDirectories(File file)
Creates necessary parent directories for a file. |
static String |
createRelativePath(File orgin,
File next)
Create relative address from orgin to next. |
static boolean |
deleteDir(File directory)
Delete file directory recursive. |
static String |
getClassName(Class clazz)
Get non qualified class name. |
static StringBuffer |
getSpaces(int length)
Get amount of spaces. |
static File |
getUserHomeDirectory()
Get home directory of user. |
static boolean |
isLetterDigitString(String text)
Tests if given String begins with a letter and contains
only letters and digits. |
static void |
loadFile(File file,
StringBuffer buffer)
Reads contents of a file into a string buffer. |
static String |
loadFile(String filename)
Reads a file and returns the contents as a String. |
static void |
loadFile(String filename,
StringBuffer buffer)
Reads contents of a file into a string buffer. |
static byte[] |
loadFileBinary(File file)
Reads a file and returns the contents as a String. |
static void |
loadStream(InputStream in,
StringBuffer buffer)
Reads contents of a stream into a string buffer. |
static void |
printAllSystemProperties()
Print current system properties to System.out. |
static String |
quote(String unquoted)
Quotes a String. |
static void |
saveFile(File file,
String text)
Saves a String in a file. |
static void |
saveFile(File file,
StringBuffer text)
Saves a StringBuffer in a file. |
static void |
saveFile(String filename,
String text)
Saves a String into a file. |
static void |
saveFile(String filename,
StringBuffer text)
Saves a StringBuffer in a file. |
static void |
saveFileBinary(File file,
byte[] data)
Saves a String in a file. |
static void |
waitln()
Waits until a '\n' was read from System.in. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static String loadFile(String filename)
throws IOException
String.
filename - Name of the file (could include path).
IOException - File exception occurred.
public static void loadFile(String filename,
StringBuffer buffer)
throws IOException
filename - Name of the file (could include path).buffer - Buffer to fill with file contents.
IOException - File exception occurred.
public static void loadStream(InputStream in,
StringBuffer buffer)
throws IOException
in - This stream will be loaded.buffer - Buffer to fill with file contents.
IOException - File exception occurred.
public static void loadFile(File file,
StringBuffer buffer)
throws IOException
file - This file will be loaded.buffer - Buffer to fill with file contents.
IOException - File exception occurred.
public static final byte[] loadFileBinary(File file)
throws IOException
String.
file - File to load from.
IOException - File exception occurred.
public static void saveFile(String filename,
String text)
throws IOException
String into a file.
filename - Name of the file (could include path).text - Data to save in the file.
IOException - File exception occurred.
public static void saveFile(String filename,
StringBuffer text)
throws IOException
StringBuffer in a file.
filename - Name of the file (could include path).text - Data to save in the file.
IOException - File exception occurred.
public static void saveFile(File file,
StringBuffer text)
throws IOException
StringBuffer in a file.
file - File to save into.text - Data to save in the file.
IOException - File exception occurred.
public static void saveFile(File file,
String text)
throws IOException
String in a file.
file - File to save the data in.text - Data to save in the file.
IOException - File exception occurred.
public static void saveFileBinary(File file,
byte[] data)
throws IOException
String in a file.
file - File to save the data in.data - Data to save in the file.
IOException - File exception occurred.
public static void copyFile(File from,
File to)
throws IOException
from - Copy source.to - Copy destination.
IOException - File exception occurred.public static String quote(String unquoted)
String. If no quotes exist in the
String, a quote character is appended at the
beginning and the end of the String.
unquoted - the unquoted String
String
NullPointerException - if unquoted == nullpublic static boolean isLetterDigitString(String text)
String begins with a letter and contains
only letters and digits.
text - test this
text only made of letters and digits and has
a leading letter?
NullPointerException - if text == nullpublic static boolean deleteDir(File directory)
directory - Directory to delete.
public static StringBuffer getSpaces(int length)
length - number of spaces
number spacespublic static String getClassName(Class clazz)
clazz - Class.
public static void printAllSystemProperties()
public static File getUserHomeDirectory()
public static void createNecessaryDirectories(File file)
file - File.
public static final String createRelativePath(File orgin,
File next)
orgin to next.
orgin - this is the original locationnext - this should be the next location
public static void waitln()
|
Hilbert II - Version 0.01.09 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ©left GNU General Public Licence All Rights Reserved. |