|
Knopflerfish OSGi 4.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.knopflerfish.ant.taskdefs.bundle.Util
public class Util
Miscellaneous static utility code.
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static org.w3c.dom.Document |
createXML(java.lang.String rootElement)
Create an empty DOM-document. |
static java.lang.String |
getRelativePath(java.io.File fromFile,
java.io.File toFile)
|
static java.lang.String |
load(java.lang.String fileOrURL)
Load entire contents of a file or URL into a string. |
static java.lang.String |
loadFile(java.lang.String fname)
|
static byte[] |
loadURL(java.net.URL url)
|
static org.w3c.dom.Document |
loadXML(java.io.File file)
Load an XML-formated file into a DOM-document. |
static java.util.Set |
makeSetFromStringList(java.lang.String s)
Create a Set from a comma-separated string. |
static java.util.Iterator |
parseEntries(java.lang.String a,
java.lang.String s,
boolean single,
boolean unique,
boolean single_entry)
Parse strings of format: ENTRY (, ENTRY)* ENTRY = key (; key)* (; PARAM)* PARAM = attribute '=' value PARAM = directive ':=' value |
static java.lang.String |
replace(java.lang.String s,
java.lang.String v1,
java.lang.String v2)
Replace all occurrences of a substring with another string. |
static java.lang.String[] |
splitwords(java.lang.String s)
Split a string into words separated by whitespace SPACE | TAB | NEWLINE | CR Citation chars '"' may be used to group words with embedded whitespace. |
static java.lang.String[] |
splitwords(java.lang.String s,
java.lang.String whiteSpace,
char citchar)
Split a string into words separated by whitespace. |
static void |
writeDocumentToFile(java.io.File outFile,
org.w3c.dom.Document doc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static byte[] loadURL(java.net.URL url)
throws java.io.IOException
java.io.IOException
public static java.lang.String loadFile(java.lang.String fname)
throws java.io.IOException
java.io.IOException
public static java.lang.String load(java.lang.String fileOrURL)
throws java.io.IOException
java.io.IOExceptionpublic static org.w3c.dom.Document loadXML(java.io.File file)
file - The XML file to load.
public static org.w3c.dom.Document createXML(java.lang.String rootElement)
rootElement - The name of the root element of the new document.
public static java.util.Set makeSetFromStringList(java.lang.String s)
public static java.lang.String getRelativePath(java.io.File fromFile,
java.io.File toFile)
public static java.lang.String replace(java.lang.String s,
java.lang.String v1,
java.lang.String v2)
If no replacements are needed, the methods returns the original string.
s - Source string which will be scanned and modified.
If null, return nullv1 - String to be replaced with v2.
If null, return original string.v2 - String replacing v1.
If null, return original string.
public static java.lang.String[] splitwords(java.lang.String s)
public static java.lang.String[] splitwords(java.lang.String s,
java.lang.String whiteSpace,
char citchar)
s - String to split.whiteSpace - whitespace to use for splitting. Any of the
characters in the whiteSpace string are considered
whitespace between words and will be removed
from the result.citchar - citation char used for enclosing words containing
whitespace
public static void writeDocumentToFile(java.io.File outFile,
org.w3c.dom.Document doc)
public static java.util.Iterator parseEntries(java.lang.String a,
java.lang.String s,
boolean single,
boolean unique,
boolean single_entry)
a - Name of attribute being parsed (for error messages).s - The attribute value to parse.single - If true, only allow one key per ENTRY.unique - Only allow unique parameters for each ENTRY.single_entry - If true, only allow one ENTRY is allowed.
java.lang.IllegalArgumentException - If syntax error in input string.
|
Knopflerfish OSGi 4.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||