|
Hilbert II - JAVA-Packages - Principia Mathematica II | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.meyling.principia.io.Utility
A collection of usefull static methods.
| Method Summary | |
static String |
createRelativePath(File orgin,
File next)
Create relative address from orgin to next. |
static boolean |
deleteDir(File dir)
|
static String |
getClassName(Class clazz)
Get non qualified class name. |
static StringBuffer |
getSpaces(int length)
Get amount of spaces. |
static File |
getUserHomeDirectory()
|
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 void |
loadStream(InputStream in,
StringBuffer buffer)
Reads contents of a stream into a string buffer. |
static void |
printAllSystemProperties()
|
static String |
quote(String unquoted)
Quotes a String. |
static void |
replace(StringBuffer text,
String search,
String replace)
Replaces all occurences of search in text
by replace and returns the result. |
static String |
replace(String text,
String search,
String replace)
Replaces all occurences of search in text
by replace and returns the result. |
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 in a file. |
static void |
saveFile(String filename,
StringBuffer text)
Saves a StringBuffer in a file. |
static void |
waitln()
Waits til 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 final String loadFile(String filename)
throws IOException
String.
filename - name of the file (could include path)
IOException - if a file exception occured
public static final void loadFile(String filename,
StringBuffer buffer)
throws IOException
filename - name of the file (could include path)buffer - buffer to fill with file contents
IOException - if a file exception occured
public static final void loadStream(InputStream in,
StringBuffer buffer)
throws IOException
in - this stream will be loadedbuffer - buffer to fill with file contents
IOException - if a file exception occured
public static final void loadFile(File file,
StringBuffer buffer)
throws IOException
file - this file will be loaded.buffer - buffer to fill with file contents.
IOException - a file exception occured.
public static final void saveFile(String filename,
String text)
throws IOException
String in a file.
filename - name of the file (could include path).text - data to save in the file.
IOException - a file exception occured.
public static final 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 - if a file exception occured.
public static final void saveFile(File file,
StringBuffer text)
throws IOException
StringBuffer in a file.
text - data to save in the file.
IOException - if a file exception occured.
public static final void saveFile(File file,
String text)
throws IOException
String in a file.
file - file.text - data to save in the file.
IOException - a file exception occured.public static final 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 ungequoted" String
String
NullPointerException - if unquoted == nullpublic static final 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 == null
public static final String replace(String text,
String search,
String replace)
search in text
by replace and returns the result.
text - text to work onsearch - replace this text by replacereplace - replacement for search
public static final void replace(StringBuffer text,
String search,
String replace)
search in text
by replace and returns the result.
text - text to work onsearch - replace this text by replacereplace - replacement for search
public static final void waitln()
public static boolean deleteDir(File dir)
public static final StringBuffer getSpaces(int length)
length - number of spaces
number spacespublic static final String getClassName(Class clazz)
clazz -
public static final void printAllSystemProperties()
public static final File getUserHomeDirectory()
public static final String createRelativePath(File orgin,
File next)
orgin to next.
orgin - this is the original locationnext - this should be the next location
|
Hilbert II - JAVA-Packages - Principia Mathematica II | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ©left GNU General Public Licence All Rights Reserved. |