[jira] [Updated] (VFS-634) DefaultFileSystemManager.close() throw FileSystemException

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Updated] (VFS-634) DefaultFileSystemManager.close() throw FileSystemException

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/VFS-634?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilian HALOUIN updated VFS-634:
-------------------------------
    Description:
Hi,
We face an issue when we use a DefaultFileSystemManager.
With this example :
{code:java}
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.Selectors;
import org.apache.commons.vfs2.VFS;
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;

/**
 * @author GHALOUIN
 *
 */
public class TestVFS {

    /**
     * @param args
     * @throws FileSystemException
     */
    public static void main(final String[] args) throws FileSystemException {
        final DefaultFileSystemManager vfsManager = (DefaultFileSystemManager) VFS.getManager();
        final FileObject tempDir = vfsManager.resolveFile("tmp://simulation");

        final FileObject fileSrc = vfsManager.resolveFile("C:/toto.txt");
        tempDir.resolveFile("toto").copyFrom(fileSrc, Selectors.SELECT_SELF);

        vfsManager.close();
    }

}
{code}

At the close call we have the following error :

INFOS: Using "C:\Users\ghalouin\AppData\Local\Temp\vfs_cache" as temporary files store.
avr. 21, 2017 4:21:27 PM org.apache.commons.vfs2.impl.StandardFileSystemManager warn
AVERTISSEMENT: Could not clean up temporary file "tmp_382_tempfs".
org.apache.commons.vfs2.FileSystemException: Incorrect file system URI "file:///C:/" in name "file:///C:/Users/ghalouin/AppData/Local/Temp/vfs_cache/tmp_382_tempfs", was expecting "file:///C:".
        at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:324)
        at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:317)
        at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:84)
        at org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider.findLocalFile(DefaultLocalFileProvider.java:106)
        at org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider.findLocalFile(DefaultLocalFileProvider.java:119)
        at org.apache.commons.vfs2.impl.DefaultFileSystemManager.toFileObject(DefaultFileSystemManager.java:1003)
        at org.apache.commons.vfs2.impl.DefaultVfsComponentContext.toFileObject(DefaultVfsComponentContext.java:78)
        at org.apache.commons.vfs2.impl.DefaultFileReplicator.deleteFile(DefaultFileReplicator.java:172)
        at org.apache.commons.vfs2.impl.DefaultFileReplicator.close(DefaultFileReplicator.java:111)
        at org.apache.commons.vfs2.impl.PrivilegedFileReplicator$CloseAction.run(PrivilegedFileReplicator.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.commons.vfs2.impl.PrivilegedFileReplicator.close(PrivilegedFileReplicator.java:113)
        at org.apache.commons.vfs2.impl.DefaultFileSystemManager.closeComponent(DefaultFileSystemManager.java:500)
        at org.apache.commons.vfs2.impl.DefaultFileSystemManager.close(DefaultFileSystemManager.java:604)
        at testVFS.TestVFS.main(TestVFS.java:29)



  was:
Hi,
We face an issue when we use a DefaultFileSystemManager.
With this example
{code:java}
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.Selectors;
import org.apache.commons.vfs2.VFS;
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;

/**
 * @author GHALOUIN
 *
 */
public class TestVFS {

    /**
     * @param args
     * @throws FileSystemException
     */
    public static void main(final String[] args) throws FileSystemException {
        final DefaultFileSystemManager vfsManager = (DefaultFileSystemManager) VFS.getManager();
        final FileObject tempDir = vfsManager.resolveFile("tmp://simulation");

        final FileObject fileSrc = vfsManager.resolveFile("C:/toto.txt");
        tempDir.resolveFile("toto").copyFrom(fileSrc, Selectors.SELECT_SELF);

        vfsManager.close();
    }

}
{code}


> DefaultFileSystemManager.close() throw FileSystemException
> ----------------------------------------------------------
>
>                 Key: VFS-634
>                 URL: https://issues.apache.org/jira/browse/VFS-634
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: windows
>            Reporter: Gilian HALOUIN
>
> Hi,
> We face an issue when we use a DefaultFileSystemManager.
> With this example :
> {code:java}
> import org.apache.commons.vfs2.FileObject;
> import org.apache.commons.vfs2.FileSystemException;
> import org.apache.commons.vfs2.Selectors;
> import org.apache.commons.vfs2.VFS;
> import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
> /**
>  * @author GHALOUIN
>  *
>  */
> public class TestVFS {
>     /**
>      * @param args
>      * @throws FileSystemException
>      */
>     public static void main(final String[] args) throws FileSystemException {
>         final DefaultFileSystemManager vfsManager = (DefaultFileSystemManager) VFS.getManager();
>         final FileObject tempDir = vfsManager.resolveFile("tmp://simulation");
>         final FileObject fileSrc = vfsManager.resolveFile("C:/toto.txt");
>         tempDir.resolveFile("toto").copyFrom(fileSrc, Selectors.SELECT_SELF);
>         vfsManager.close();
>     }
> }
> {code}
> At the close call we have the following error :
> INFOS: Using "C:\Users\ghalouin\AppData\Local\Temp\vfs_cache" as temporary files store.
> avr. 21, 2017 4:21:27 PM org.apache.commons.vfs2.impl.StandardFileSystemManager warn
> AVERTISSEMENT: Could not clean up temporary file "tmp_382_tempfs".
> org.apache.commons.vfs2.FileSystemException: Incorrect file system URI "file:///C:/" in name "file:///C:/Users/ghalouin/AppData/Local/Temp/vfs_cache/tmp_382_tempfs", was expecting "file:///C:".
> at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:324)
> at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:317)
> at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:84)
> at org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider.findLocalFile(DefaultLocalFileProvider.java:106)
> at org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider.findLocalFile(DefaultLocalFileProvider.java:119)
> at org.apache.commons.vfs2.impl.DefaultFileSystemManager.toFileObject(DefaultFileSystemManager.java:1003)
> at org.apache.commons.vfs2.impl.DefaultVfsComponentContext.toFileObject(DefaultVfsComponentContext.java:78)
> at org.apache.commons.vfs2.impl.DefaultFileReplicator.deleteFile(DefaultFileReplicator.java:172)
> at org.apache.commons.vfs2.impl.DefaultFileReplicator.close(DefaultFileReplicator.java:111)
> at org.apache.commons.vfs2.impl.PrivilegedFileReplicator$CloseAction.run(PrivilegedFileReplicator.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.apache.commons.vfs2.impl.PrivilegedFileReplicator.close(PrivilegedFileReplicator.java:113)
> at org.apache.commons.vfs2.impl.DefaultFileSystemManager.closeComponent(DefaultFileSystemManager.java:500)
> at org.apache.commons.vfs2.impl.DefaultFileSystemManager.close(DefaultFileSystemManager.java:604)
> at testVFS.TestVFS.main(TestVFS.java:29)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
Loading...