|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.ucsb.adl.bucket99.FileLoader
Loads files from URLs.
$Log: FileLoader.java,v $
Revision 1.3 2008/05/19 20:50:11 gjanee
Bug fix: added application/xml as an acceptable
MIME type.
Revision 1.2 2001/11/16 05:54:22 gjanee
Internationalization support. In all versions of
loadXMLFile we attempt to set the character encoding
based on the URL connection's MIME content type. The encoding
declaration in the XML header, if any, is ignored and removed.
Added a version of loadXMLFile that loads a document
from a local file.
Revision 1.1 2000/05/02 20:15:24 gjanee
Initial revision
| Method Summary | |
static java.lang.String |
loadXMLFile(java.io.File file)
Loads a file containing an XML document. |
static java.lang.String |
loadXMLFile(java.net.URL url)
Loads a file containing an XML document from a URL. |
static java.lang.Object[] |
loadXMLFileIfModified(java.net.URL url,
long lastModificationTime)
Loads a file containing an XML document from a URL. |
| 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 loadXMLFile(java.net.URL url)
throws InternalErrorException
text/xml and by looking at the first few
characters of the document. The document's character encoding
is obtained from the URL connection if the URL protocol
supports it and if specified; otherwise, the platform's
default encoding is assumed. The encoding declaration in the
document, if any, is removed.
url - The URL.
InternalErrorException - If the load fails for any reason.
public static java.lang.Object[] loadXMLFileIfModified(java.net.URL url,
long lastModificationTime)
throws InternalErrorException
As with loadXMLFile, this method attempts to
verify that the URL does indeed refer to an XML document by
checking that the returned MIME type is text/xml
and by looking at the first few characters of the document.
The document's character encoding is obtained from the URL
connection if the URL protocol supports it and if specified;
otherwise, the platform's default encoding is assumed. The
encoding declaration in the document, if any, is removed.
url - The URL.lastModificationTime - If positive, a time in the semantics of
URLConnection.ifModifiedSince against which the
file's modification time is compared. If nonpositive, this
argument is ignored and the file is always loaded.
String, is the XML document, and the
second element, a Long, is the file's modification
time in the semantics of
URLConnection.getLastModified. If the file was
not loaded, null.
InternalErrorException - If the load fails for any reason.
public static java.lang.String loadXMLFile(java.io.File file)
throws InternalErrorException
file - The file.
InternalErrorException - If the load fails for any reason.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||