From issues-return-8407-apmail-commons-issues-archive=commons.apache.org@commons.apache.org Wed Jun 10 10:26:19 2009 Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 3272 invoked from network); 10 Jun 2009 10:26:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jun 2009 10:26:19 -0000 Received: (qmail 96721 invoked by uid 500); 10 Jun 2009 10:26:30 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 96617 invoked by uid 500); 10 Jun 2009 10:26:30 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 96607 invoked by uid 99); 10 Jun 2009 10:26:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 10:26:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 10:26:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B769F234C004 for ; Wed, 10 Jun 2009 03:26:07 -0700 (PDT) Message-ID: <1236174944.1244629567746.JavaMail.jira@brutus> Date: Wed, 10 Jun 2009 03:26:07 -0700 (PDT) From: "Didier Earith (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (VFS-241) Unable to download file if saved in FTP root directory In-Reply-To: <2031616916.1236152036136.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/VFS-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Didier Earith updated VFS-241: ------------------------------ Attachment: AbstractFileObject.java Hi, I get the same issue. The java.lang.NullPointerException is raised in the getParent function of the AbstractFileObject class : ...... synchronized (fs) { // Locate the parent of this file if (parent == null) { parent = fs.resolveFile(name.getParent()); } } return parent; } name.getParent() can return null (if name is the root). To fix the issue, I have changed the this function to test the result of name.getParent() call. If null then return null : .... synchronized (fs) { // Locate the parent of this file if (parent == null) { if (name.getParent() == null) { return null; } parent = fs.resolveFile(name.getParent()); } } return parent; } (see java source file as attachement). Didier Earith > Unable to download file if saved in FTP root directory > ------------------------------------------------------ > > Key: VFS-241 > URL: https://issues.apache.org/jira/browse/VFS-241 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.0 > Environment: WIndows XP, Linux > Reporter: Michal Ruman > Attachments: AbstractFileObject.java > > > Problem with file downloading when file is saved in FTP root directory. > After clicking on download link get exception: > java.lang.NullPointerException > at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:272) > at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:267) > at org.apache.commons.vfs.provider.AbstractFileObject.getParent(AbstractFileObject.java:512) > at org.apache.commons.vfs.provider.ftp.FtpFileObject.getInfo(FtpFileObject.java:177) > at org.apache.commons.vfs.provider.ftp.FtpFileObject.refresh(FtpFileObject.java:208) > at org.apache.commons.vfs.impl.DecoratedFileObject.refresh(DecoratedFileObject.java:170) > at org.apache.commons.vfs.cache.OnCallRefreshFileObject.getChild(OnCallRefreshFileObject.java:98) > ... > Michal Ruman -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.