commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcar...@apache.org
Subject svn commit: r659811 - /commons/proper/vfs/branches/vfs-1-trunk/core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
Date Sat, 24 May 2008 12:53:57 GMT
Author: jcarman
Date: Sat May 24 05:53:57 2008
New Revision: 659811

URL: http://svn.apache.org/viewvc?rev=659811&view=rev
Log:
VFS-196: FTP Provider Does Not Support Symbolic Links Correctly

Modified:
    commons/proper/vfs/branches/vfs-1-trunk/core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java

Modified: commons/proper/vfs/branches/vfs-1-trunk/core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/branches/vfs-1-trunk/core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java?rev=659811&r1=659810&r2=659811&view=diff
==============================================================================
--- commons/proper/vfs/branches/vfs-1-trunk/core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
(original)
+++ commons/proper/vfs/branches/vfs-1-trunk/core/src/main/java/org/apache/commons/vfs/provider/ftp/FtpFileObject.java
Sat May 24 05:53:57 2008
@@ -24,6 +24,9 @@
 import org.apache.commons.vfs.FileSystemException;
 import org.apache.commons.vfs.FileType;
 import org.apache.commons.vfs.RandomAccessContent;
+import org.apache.commons.vfs.FileSystemManager;
+import org.apache.commons.vfs.VFS;
+import org.apache.commons.vfs.FileUtil;
 import org.apache.commons.vfs.provider.AbstractFileObject;
 import org.apache.commons.vfs.provider.UriParser;
 import org.apache.commons.vfs.util.Messages;
@@ -35,6 +38,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.File;
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.Iterator;
@@ -125,7 +129,8 @@
 		final FtpClient client = ftpFs.getClient();
 		try
 		{
-			final FTPFile[] tmpChildren = client.listFiles(relPath);
+            final String path = fileInfo != null && fileInfo.isSymbolicLink() ? getFileSystem().getFileSystemManager().resolveName(getParent().getName(),
fileInfo.getLink() ).getPath() : relPath;
+            final FTPFile[] tmpChildren = client.listFiles(path);
 			if (tmpChildren == null || tmpChildren.length == 0)
 			{
 				children = EMPTY_FTP_FILE_MAP;



Mime
View raw message