You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ec...@apache.org on 2015/09/23 17:41:30 UTC
svn commit: r1704885 - in /commons/proper/vfs/trunk:
core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileSystem.java
core/src/test/java/org/apache/commons/vfs2/test/VerifyingFileSelector.java
src/changes/changes.xml
Author: ecki
Date: Wed Sep 23 15:41:29 2015
New Revision: 1704885
URL: http://svn.apache.org/viewvc?rev=1704885&view=rev
Log:
[VFS-279] better support for ON_CALL cache
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileSystem.java
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/VerifyingFileSelector.java
commons/proper/vfs/trunk/src/changes/changes.xml
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileSystem.java?rev=1704885&r1=1704884&r2=1704885&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileSystem.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileSystem.java Wed Sep 23 15:41:29 2015
@@ -28,6 +28,7 @@ import org.apache.commons.vfs2.FileSyste
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.provider.AbstractFileName;
import org.apache.commons.vfs2.provider.AbstractFileSystem;
+import org.apache.commons.vfs2.util.FileObjectUtils;
/**
* A local file system.
@@ -72,7 +73,7 @@ public class LocalFileSystem
final FileSelector selector)
throws Exception
{
- final LocalFile localFile = (LocalFile) fileObject;
+ final LocalFile localFile = (LocalFile) FileObjectUtils.getAbstractFileObject(fileObject);
final File file = localFile.getLocalFile();
final SecurityManager sm = System.getSecurityManager();
if (sm != null)
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/VerifyingFileSelector.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/VerifyingFileSelector.java?rev=1704885&r1=1704884&r2=1704885&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/VerifyingFileSelector.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/VerifyingFileSelector.java Wed Sep 23 15:41:29 2015
@@ -26,6 +26,8 @@ import org.apache.commons.vfs2.FileSelec
import org.apache.commons.vfs2.FileSelector;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileType;
+import org.apache.commons.vfs2.provider.AbstractFileObject;
+import org.apache.commons.vfs2.util.FileObjectUtils;
import org.junit.Assert;
/**
@@ -88,7 +90,7 @@ public class VerifyingFileSelector
throws FileSystemException
{
// Check that the given file is a folder
- final FileObject folder = fileInfo.getFile();
+ final FileObject folder = FileObjectUtils.getAbstractFileObject(fileInfo.getFile());
assertSame(FileType.FOLDER, folder.getType());
assertTrue(folder.isFolder());
@@ -101,7 +103,8 @@ public class VerifyingFileSelector
}
else
{
- assertSame(currentFolder, folder.getParent());
+ AbstractFileObject parent = FileObjectUtils.getAbstractFileObject(folder.getParent());
+ assertSame(currentFolder, parent);
// Locate the info for the child, and make sure it is folder
currentFolderInfo = getChild(baseName);
Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1704885&r1=1704884&r2=1704885&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Wed Sep 23 15:41:29 2015
@@ -26,8 +26,11 @@
<!-- <action issue="VFS-443" dev="ggregory" type="update" due-to="nickallen"> -->
<!-- [Local] Need an easy way to convert from a FileObject to a File. -->
<!-- </action> -->
+ <action issue="VFS-279" dev="ecki" type="fix" due-to="Didier Earith, Simon Legner">
+ [local] Avoid ClassCastException when replicating local files while OnCall caching is active.
+ </action>
<action issue="VFS-297" dev="joehni" type="fix" due-to="Kirill Safonov, Jimmy Praet">
- [core/sftp] VSF fails to reuse FileSystem instances if FileSystemOptions contain
+ [sftp] VSF fails to reuse FileSystem instances if FileSystemOptions contain
an array as value. Reported for SFTP using identities.
</action>
<action issue="VFS-198" dev="ecki" type="add" due-to="Andrew Franklin, Simon Legner">