org.apache.openjpa.lib.meta
public class: URLMetaDataIterator [javadoc |
source]
java.lang.Object
org.apache.openjpa.lib.meta.URLMetaDataIterator
All Implemented Interfaces:
MetaDataIterator
Iterator over the metadata resource represented by a URL.
- author:
Abe - White
- nojavadoc:
| Method from org.apache.openjpa.lib.meta.URLMetaDataIterator Detail: |
public void close() {
}
|
public File getFile() {
if (!_iterated)
throw new IllegalStateException();
if (_url == null)
return null;
File file = new File(URLDecoder.decode(_url.getPath()));
return (((Boolean) AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file:null;
}
|
public InputStream getInputStream() throws IOException {
if (!_iterated)
throw new IllegalStateException();
if (_url == null)
return null;
try {
return (InputStream) AccessController.doPrivileged(
J2DoPrivHelper.openStreamAction(_url));
} catch (PrivilegedActionException pae) {
throw (IOException) pae.getException();
}
}
|
public boolean hasNext() {
return _url != null && !_iterated;
}
|
public Object next() throws IOException {
if (!hasNext())
throw new IllegalStateException();
_iterated = true;
return _url;
}
|