org.knopflerfish.ant.taskdefs.bundle
Class FileUtil
java.lang.Object
org.knopflerfish.ant.taskdefs.bundle.FileUtil
public class FileUtil
- extends java.lang.Object
|
Method Summary |
static org.w3c.dom.Document |
createXML(java.lang.String rootElement)
Create an empty DOM-document. |
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 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 |
FileUtil
public FileUtil()
loadURL
public static byte[] loadURL(java.net.URL url)
throws java.io.IOException
- Throws:
java.io.IOException
loadFile
public static java.lang.String loadFile(java.lang.String fname)
throws java.io.IOException
- Throws:
java.io.IOException
load
public static java.lang.String load(java.lang.String fileOrURL)
throws java.io.IOException
- Load entire contents of a file or URL into a string.
- Throws:
java.io.IOException
loadXML
public static org.w3c.dom.Document loadXML(java.io.File file)
- Load an XML-formated file into a DOM-document.
- Parameters:
file - The XML file to load.
- Returns:
- DOM document.
createXML
public static org.w3c.dom.Document createXML(java.lang.String rootElement)
- Create an empty DOM-document.
- Parameters:
rootElement - The name of the root element of the new document.
- Returns:
- DOM document with a root element.
writeDocumentToFile
public static void writeDocumentToFile(java.io.File outFile,
org.w3c.dom.Document doc)