commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r279064 - in /jakarta/commons/proper/vfs/trunk: RELEASE_NOTES.txt src/java/org/apache/commons/vfs/Resources.properties src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
Date Tue, 06 Sep 2005 18:51:18 GMT
Author: imario
Date: Tue Sep  6 11:51:10 2005
New Revision: 279064

URL: http://svn.apache.org/viewcvs?rev=279064&view=rev
Log:
ignore nonparseable ftp directory entries. It will be logged using the debug log-level
with class org.apache.commons.vfs.provider.ftp.FtpFileObject.
(e.g. empty lines in ftp directory listing)

Modified:
    jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/Resources.properties
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java

Modified: jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt?rev=279064&r1=279063&r2=279064&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt (original)
+++ jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt Tue Sep  6 11:51:10 2005
@@ -3,6 +3,7 @@
 threading:
 avoid gc when referencing only inputStream/outputStream of a fileObject
 
+
 filenames:
 add a type (file/folder) to filename.
 This is needed to allow URI style filename resolving
@@ -10,18 +11,25 @@
 of "file:///path/to/file/any/file"
 This is experimental code. Switch on with "VFS.setUriStyle(true);" before ANY other VFS operation.
 
+
 ant tasks:
 added antlib.xml - (Jacob Kjome)
 
+
 zip, jar, ....:
 allow filenames without trailing "!"
 allow createFilesystem with .gz files
 better handling of file/folder flag with compressed files
 
+
 ftp:
 check IOException instead of FTPConnectionClosedException.
 This should make ftp retry more robust even if for some case the state of the
 socket isnt correctly reported as closed.
+
+ignore nonparseable ftp directory entries. It will be logged using the debug log-level
+with class org.apache.commons.vfs.provider.ftp.FtpFileObject.
+(e.g. empty lines in ftp directory listing)
 
 
 2005-08-13  commons-vfs 1.0 RC3

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/Resources.properties
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/Resources.properties?rev=279064&r1=279063&r2=279064&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/Resources.properties
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/Resources.properties
Tue Sep  6 11:51:10 2005
@@ -194,6 +194,7 @@
 vfs.provider.ftp/connect.error=Could not connect to FTP server on "{0}".
 vfs.provider.ftp/close-connection.error=Could not close connection to FTP server.
 vfs.provider.ftp/change-work-directory.error=Could not change to work directory "{0}".
+vfs.provider.ftp/invalid-directory-entry.debug=Invalid directory entry at line "{0}" (directory
"{1}").
 
 # URL Provider
 vfs.provider.url/badly-formed-uri.error=Badly formed URI "{0}".

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java?rev=279064&r1=279063&r2=279064&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
Tue Sep  6 11:51:10 2005
@@ -15,6 +15,8 @@
  */
 package org.apache.commons.vfs.provider.ftp;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.net.ftp.FTPFile;
 import org.apache.commons.vfs.FileName;
 import org.apache.commons.vfs.FileObject;
@@ -23,6 +25,7 @@
 import org.apache.commons.vfs.RandomAccessContent;
 import org.apache.commons.vfs.provider.AbstractFileObject;
 import org.apache.commons.vfs.provider.UriParser;
+import org.apache.commons.vfs.util.Messages;
 import org.apache.commons.vfs.util.MonitorInputStream;
 import org.apache.commons.vfs.util.MonitorOutputStream;
 import org.apache.commons.vfs.util.RandomAccessMode;
@@ -44,6 +47,8 @@
 public class FtpFileObject
     extends AbstractFileObject
 {
+    private Log log = LogFactory.getLog(FtpFileObject.class);
+
     private static final FTPFile[] EMPTY_FTP_FILE_ARRAY = {};
 
     private final FtpFileSystem ftpFs;
@@ -133,6 +138,18 @@
                 for (int i = 0; i < tmpChildren.length; i++)
                 {
                     final FTPFile child = tmpChildren[i];
+                    if (child == null)
+                    {
+                        if (log.isDebugEnabled())
+                        {
+                            log.debug(Messages.getString("vfs.provider.ftp/invalid-directory-entry.debug",
+                                new Object[]
+                                    {
+                                        new Integer(i), relPath
+                                    }));
+                        }
+                        continue;
+                    }
                     if (!".".equals(child.getName())
                         && !"..".equals(child.getName()))
                     {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message