|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDTDDoc.Tools
public class Tools
A class that gather some useful tools.
Field Summary | |
---|---|
static java.util.List |
HTML_TAGS
|
Constructor Summary | |
---|---|
Tools()
|
Method Summary | |
---|---|
static void |
copy(java.io.File sourceFile,
java.io.File destinationFile)
Copy one file into antoher. |
static void |
copyFromResource(java.lang.String name,
java.io.File destinationFile)
Copies a resource file (in-jar) to a given destination. |
static java.util.List |
enumerationToList(java.util.Enumeration enumeration)
|
static java.lang.String |
escapeHTMLUnicode(java.lang.String s,
boolean javascript)
Escape all non-ASCII character in a UNICODE string. |
static java.lang.String |
getFilename(java.lang.String path)
Extract the file name out of a full path. |
static java.lang.String |
join(java.lang.String[] array,
java.lang.String separator)
|
static java.lang.String[] |
listToArray(java.lang.String s,
java.lang.String separator)
Transform a list into an array. |
static void |
makeFileDir(java.io.File f)
Will create the directories present in the path of a file. |
static java.io.File |
parent(java.io.File f)
Get the parent of a given path. |
static java.lang.String |
replace(java.lang.String src,
java.lang.String token,
java.lang.String with)
|
static java.util.Collection |
sort(java.util.Collection collection,
java.util.Comparator comparator)
Returns a sorted copy of a given collection. |
static boolean |
startsWithHtmlTag(java.lang.String txt)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.List HTML_TAGS
Constructor Detail |
---|
public Tools()
Method Detail |
---|
public static void copyFromResource(java.lang.String name, java.io.File destinationFile) throws FileCopyException
name
- Full path to the resource (relative to the jar though).destinationFile
- Where to copy the file.
FileCopyException
public static void copy(java.io.File sourceFile, java.io.File destinationFile) throws java.io.IOException
sourceFile
- Source path.destinationFile
- Destination path.
java.io.IOException
public static java.io.File parent(java.io.File f)
f
- The path.
public static java.util.Collection sort(java.util.Collection collection, java.util.Comparator comparator)
collection
- Colelction to sort.comparator
- Comparator to use while sorting.
public static java.lang.String[] listToArray(java.lang.String s, java.lang.String separator)
s
- The listseparator
- the separator.
public static java.lang.String join(java.lang.String[] array, java.lang.String separator)
public static java.lang.String escapeHTMLUnicode(java.lang.String s, boolean javascript)
Additionally, this function can escape the single quote character for Javascript strings.
s
- String to escape. If null, nothing is done.javascript
- If true, escapes the single quote character into
\' so that it can appear in a single quote delimited Javascript
string.
public static java.util.List enumerationToList(java.util.Enumeration enumeration)
public static java.lang.String getFilename(java.lang.String path)
path
- The full path.
public static void makeFileDir(java.io.File f) throws java.io.IOException
f
- The file to get the path from.
java.io.IOException
public static boolean startsWithHtmlTag(java.lang.String txt)
public static java.lang.String replace(java.lang.String src, java.lang.String token, java.lang.String with)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |