commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r307027 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java
Date Fri, 07 Oct 2005 06:06:00 GMT
Author: imario
Date: Thu Oct  6 23:05:50 2005
New Revision: 307027

URL: http://svn.apache.org/viewcvs?rev=307027&view=rev
Log:
enh: ignore "./" and "../"

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java?rev=307027&r1=307026&r2=307027&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java
Thu Oct  6 23:05:50 2005
@@ -23,6 +23,7 @@
 import org.apache.commons.vfs.FileSystemException;
 import org.apache.commons.vfs.FileType;
 import org.apache.commons.vfs.RandomAccessContent;
+import org.apache.commons.vfs.VFS;
 import org.apache.commons.vfs.provider.AbstractFileObject;
 import org.apache.commons.vfs.provider.UriParser;
 import org.apache.commons.vfs.util.MonitorOutputStream;
@@ -263,10 +264,17 @@
                     trigger=!trigger;
                 }
             }
+            if (VFS.isUriStyle())
+            {
+                if (stat.charAt(0) == 'd' && nameBuf.charAt(nameBuf.length()-1) !=
'/')
+                {
+                    nameBuf.append("/");
+                }
+            }
             // <==
 
             final String name = nameBuf.toString();
-            if (name.equals(".") || name.equals(".."))
+            if (name.equals(".") || name.equals("..") || name.equals("./") || name.equals("../"))
             {
                 continue;
             }
@@ -292,7 +300,7 @@
     {
         return new SftpRandomAccessContent(this, mode);
     }
-    
+
     /**
      * Creates an input stream to read the file content from.
      */



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