commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam R. B. Jack" <aj...@trysybase.com>
Subject [VFS] Crashes in getContent()
Date Wed, 20 Aug 2003 17:47:20 GMT
Over the last few days we've started to see runtime failures due to a crash
inside VFS.

An example is on the public gump (so using nightly from CVS) and it has
happened two nights in a row (at least).
http://cvs.apache.org/builds/gump/2003-08-20/krysalis-centipede-site.html

The crash is at:

 java.lang.NullPointerException at
org.apache.commons.vfs.provider.AbstractFileObject.getInputStream
(AbstractFileObject.java:821)
at org.apache.commons.vfs.provider.DefaultFileContent.getInputStream
(DefaultFileContent.java:289)
at org.krysalis.ruper.util.VfsUtils.getChildren(VfsUtils.java:176)
at

We have a helper method which we use to try to sniff "children" for a
directory listing url -- since current VFS has no sense of folder (or
children) for HTTP 'files'. The code has been working for a long time, but
recently stopped working.

I don't know if this is using HTTPClient or java.net.URL, but I assume the
former.

Can anybody help?

regards

Adam


public static FileObject[] getChildren(FileObject folder)

throws IOException, MalformedURLException, FileSystemException {

FileObject[] result = null;

if (folder.getFileSystem().hasCapability(Capability.LIST_CHILDREN)) {

if (folder.getType() == FileType.FILE) {

result = new FileObject[] { folder };

}

else {

result = folder.getChildren();

}

}

else if ("http".equals(folder.getURL().getProtocol())) {

ArrayList list = new ArrayList();

// try opening the URL

InputStream urlStream = folder.getContent().getInputStream();

String type = URLConnection.guessContentTypeFromStream(urlStream);

if ((type == null) || (type.compareTo("text/html") != 0)) {


--
ExperienceSybase Technology...
http://www.try.sybase.com


Mime
View raw message