commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r320876 - in /jakarta/commons/proper/vfs/trunk: RELEASE_NOTES.txt src/java/org/apache/commons/vfs/provider/UriParser.java src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java
Date Thu, 13 Oct 2005 19:11:42 GMT
Author: imario
Date: Thu Oct 13 12:11:33 2005
New Revision: 320876

URL: http://svn.apache.org/viewcvs?rev=320876&view=rev
Log:
sftp: stip off link file names, though still no link-support.
Should be sufficient to parse such directory listings.
fix: NPE in UriParser

Modified:
    jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/UriParser.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.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=320876&r1=320875&r2=320876&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt (original)
+++ jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt Thu Oct 13 12:11:33 2005
@@ -3,6 +3,9 @@
 zip, jar, tar:
 close archive if there is no open stream. This avoids locking on the archive.
 
+sftp:
+stip off link file names, though still no link-support for sftp.
+
 
 2005-09-26  commons-vfs 1.0 RC4
 

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/UriParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/UriParser.java?rev=320876&r1=320875&r2=320876&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/UriParser.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/UriParser.java
Thu Oct 13 12:11:33 2005
@@ -400,6 +400,10 @@
 
     public static String[] encode(String[] strings)
     {
+        if (strings == null)
+        {
+            return null;
+        }
         for (int i = 0; i < strings.length; i++)
         {
             strings[i] = encode(strings[i]);

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=320876&r1=320875&r2=320876&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 13 12:11:33 2005
@@ -250,7 +250,7 @@
             boolean trigger = true;
             int state = 0;
             StringBuffer nameBuf = new StringBuffer(stat.length());
-            for (int i = 0; i<stat.length(); i++)
+            for (int i = 0; i < stat.length(); i++)
             {
                 char c = stat.charAt(i);
                 if (state == 16)
@@ -261,19 +261,26 @@
                 if ((c != ' ' && trigger) || (c == ' ' && !trigger))
                 {
                     state++;
-                    trigger=!trigger;
+                    trigger = !trigger;
                 }
             }
             if (VFS.isUriStyle())
             {
-                if (stat.charAt(0) == 'd' && nameBuf.charAt(nameBuf.length()-1) !=
'/')
+                if (stat.charAt(0) == 'd' && nameBuf.charAt(nameBuf.length() - 1)
!= '/')
                 {
                     nameBuf.append("/");
                 }
             }
             // <==
 
-            final String name = nameBuf.toString();
+            String name = nameBuf.toString();
+            int linkPos = name.indexOf(" -> ");
+            if (linkPos > -1)
+            {
+                // link = name.substring(linkPos + 4);
+                name = name.substring(0, linkPos);
+            }
+
             if (name.equals(".") || name.equals("..") || name.equals("./") || name.equals("../"))
             {
                 continue;



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