commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam R. B. Jack" <>
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).

The crash is at:

 java.lang.NullPointerException at
at org.apache.commons.vfs.provider.DefaultFileContent.getInputStream
at org.krysalis.ruper.util.VfsUtils.getChildren(

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, but I assume the

Can anybody help?



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...

View raw message