|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.cam.spectra.Util
public class Util
Usual grab bag of utility functions that don't fit anywhere else conveniently.
| Method Summary | |
|---|---|
static java.lang.String |
buildPath(java.lang.String... parts)
Builds a platform specific file path from the path name parts passed in. |
static void |
copy(java.io.File from,
java.io.File to)
DEWISOTT. |
static void |
move(java.io.File from,
java.io.File to)
Yet another method that java.io.File should possess, performs an atomic move if possible, otherwise a non-atomic one. |
static java.util.Date |
parseDate(java.lang.String dateStr)
Parse a date according to a number of standard formats. |
static void |
print(nu.xom.Document doc,
java.io.OutputStream out,
boolean pretty)
Prints a XOM document to an outputstream without having to remember the serializer voodoo. |
static nu.xom.Attribute |
queryUniqueAttribute(nu.xom.Document doc,
java.lang.String query,
nu.xom.XPathContext xpathContext)
Utility method to return the result of an xpath query you know is going to return a single text node. |
static void |
rmr(java.io.File dir)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String buildPath(java.lang.String... parts)
parts - directory names and an optional file name
public static void copy(java.io.File from,
java.io.File to)
throws java.io.IOException
from - source fileto - target file
java.io.IOException
java.io.IOException - rethrown from java.io.
public static void move(java.io.File from,
java.io.File to)
throws java.io.IOException
from - source fileto - target file
java.io.IOException - rethrown from java.io
public static nu.xom.Attribute queryUniqueAttribute(nu.xom.Document doc,
java.lang.String query,
nu.xom.XPathContext xpathContext)
doc - XOM document to queryquery - the XPath queryxpathContext - the XPath context to resolve namespaces
java.lang.RuntimeException - if the query doesn't return a single node, or if the node
returned is not a text node.
public static void print(nu.xom.Document doc,
java.io.OutputStream out,
boolean pretty)
doc - the XOM DOcument to printout - where to print topretty - should it be pretty printed?
java.io.IOException - rethrown from the XOM serializerpublic static java.util.Date parseDate(java.lang.String dateStr)
dateStr - the date as a string
public static void rmr(java.io.File dir)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||