|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.init.its.util.Util
public final class Util
Support class to implement overall need functionality
Nested Class Summary | |
---|---|
static interface |
Util.Executor<T>
Simple executor delegator interface |
static interface |
Util.MatcherOp<T>
Simple Boolean Matcher Executor Interface |
Field Summary | |
---|---|
static java.lang.String |
HOME
The HOME directory java is working in |
Method Summary | ||
---|---|---|
static boolean |
containsKeyPrefix(java.util.Map<java.lang.String,java.lang.String> map,
java.lang.String prefix)
Returns true if the map contains a key with the provided prefix |
|
static org.xml.sax.InputSource |
convertFrom(java.lang.String plainXMLRepresenation)
Convenience Method to convert a string represenation of an xml document to an InputSource |
|
static java.lang.String |
crop(java.lang.String input,
java.lang.String begin,
java.lang.String end)
crops a string according to start and end (both exclusive) delimiters. |
|
static java.lang.String |
cut(java.lang.String str,
java.lang.String delim,
int field)
tokenizes a string by delimiter and returns the n th field (begin index with 0) |
|
static java.lang.String |
escape(java.lang.String str)
Escapes almost all possible occurences of: \t \r \n \s \d : , - = |
|
static java.lang.String |
extractPath(java.lang.String path)
Extracts the Path to a File (eg. the Parent Dir) |
|
static java.io.File |
extractZipEntry(java.lang.String zipResource,
java.lang.String entryName)
Extracts an entry from a zip file and saves it as temporary resource. |
|
static java.lang.String |
format(java.lang.String s,
java.lang.Object... o)
Formats a given String. |
|
static java.lang.String |
getStringContent(java.io.File file)
Returns the String representation of a File. |
|
static java.lang.String |
join(java.lang.String a,
java.lang.Object... b)
Joins a String with given Object parameters |
|
static
|
matchesAny(java.util.Map<java.lang.String,java.lang.String> map,
java.lang.String... args)
Returns true, if any of the supplied arguments are contained in the map |
|
static
|
matchSingle(Util.MatcherOp<T> executor,
java.util.List<T> list)
Uses a boolean delegate to evaluate all arguments, returns true if one of the arguments matches a condition defined by the delegate |
|
static java.net.URI |
mkTmpCopy(java.net.URI uri,
java.lang.String suffix)
Copies a file |
|
static java.net.URI |
prepreXLIFFOutput()
|
|
static void |
println(java.lang.String string,
java.lang.Object... format)
Calls System.out.printline with a more advanced formatting of objects (Backward compatibility for Java 5) |
|
static java.lang.String |
rep(java.lang.String sym,
int times)
Repeats a string n times and returns it |
|
static java.io.File |
toFile(java.lang.String resource)
returns a file reference for a resource |
|
static org.xml.sax.InputSource |
toInputSource(java.io.File resource)
Returns a textual file as InputSource |
|
static org.xml.sax.InputSource |
toInputSource(java.lang.String resource)
Returns a textual file as InputSource |
|
static org.xml.sax.InputSource |
toInputSourceFromZip(java.lang.String resource,
java.lang.String zipEntry)
Reads a zipFile and returns a specific Zip Entry as InputSource and returns it. |
|
static void |
writeToDisk(java.lang.String path,
java.lang.String content)
Writes string content to disk |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HOME
Method Detail |
---|
public static org.xml.sax.InputSource toInputSource(java.lang.String resource) throws java.lang.Exception
resource
- the absolute path to a resource
java.lang.Exception
public static java.net.URI mkTmpCopy(java.net.URI uri, java.lang.String suffix)
uri
- suffix
-
public static org.xml.sax.InputSource toInputSource(java.io.File resource) throws java.lang.Exception
resource
-
java.lang.Exception
public static org.xml.sax.InputSource toInputSourceFromZip(java.lang.String resource, java.lang.String zipEntry) throws java.lang.Exception
resource
- the zip filezipEntry
- the entry to be returned as InputSource
java.lang.Exception
public static java.io.File extractZipEntry(java.lang.String zipResource, java.lang.String entryName) throws java.lang.Exception
zipResource
- the zip file (like an odt file)entryName
- the name of the entry to extract
java.lang.Exception
public static org.xml.sax.InputSource convertFrom(java.lang.String plainXMLRepresenation) throws java.lang.Exception
plainXMLRepresenation
-
java.lang.Exception
public static java.lang.String join(java.lang.String a, java.lang.Object... b)
a
- a String as startb
- various elements to join with String a
public static boolean containsKeyPrefix(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String prefix)
map
- the map to check for a key with a given prefixprefix
- the prefix to check for existence
public static java.lang.String crop(java.lang.String input, java.lang.String begin, java.lang.String end)
input
- the input to be croppedbegin
- the start delimiterend
- the end delimiter
public static java.lang.String cut(java.lang.String str, java.lang.String delim, int field)
str
- the string to be cutdelim
- the delimiter to split the stringfield
- the field, that needs to be returned
public static java.lang.String escape(java.lang.String str)
str
- the string that may contain possible control characters
public static java.lang.String format(java.lang.String s, java.lang.Object... o)
s
- the simple string with {} as replacement symbolo
- a variable number of parameters
public static <T> boolean matchesAny(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String... args)
map
- the map to look for key entriesargs
- the arguments to match any of the key entries
public static <T> boolean matchSingle(Util.MatcherOp<T> executor, java.util.List<T> list)
executor
- a delegate to match a single argument in listlist
- a list of argument values
public static java.lang.String extractPath(java.lang.String path)
path
-
public static void writeToDisk(java.lang.String path, java.lang.String content) throws java.lang.Exception
path
- content
-
java.lang.Exception
public static java.lang.String rep(java.lang.String sym, int times)
sym
- times
-
public static java.io.File toFile(java.lang.String resource) throws java.io.FileNotFoundException
resource
-
java.io.FileNotFoundException
public static java.lang.String getStringContent(java.io.File file) throws java.lang.Exception
file
- the source file
java.lang.Exception
public static java.net.URI prepreXLIFFOutput()
public static void println(java.lang.String string, java.lang.Object... format)
string
- the string containing {} as placeholder for valuesformat
- the formatting values, can be empty (not null)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |