Examples of FileSystemProvider


Examples of java.nio.file.spi.FileSystemProvider

        }
    }

    private FileSystemProvider getZipFileSystemProvider() throws IOException {
        // This is a little bit of a hack to get around a JAVA 7 bug (hopefully fixed in JAVA 8
        FileSystemProvider zipProvider = null;
        for (FileSystemProvider provider : FileSystemProvider.installedProviders()) {
            if ("jar".equalsIgnoreCase(provider.getScheme())) {
                zipProvider = provider;
            }
        }
View Full Code Here

Examples of java.nio.file.spi.FileSystemProvider

     *          LinkPermission}{@code ("symbolic")}.
     */
    public static Path copy(Path source, Path target, CopyOption... options)
        throws IOException
    {
        FileSystemProvider provider = provider(source);
        if (provider(target) == provider) {
            // same provider
            provider.copy(source, target, options);
        } else {
            // different providers
            CopyMoveHelper.copyToForeignTarget(source, target, options);
        }
        return target;
View Full Code Here

Examples of java.nio.file.spi.FileSystemProvider

     *          target file.
     */
    public static Path move(Path source, Path target, CopyOption... options)
        throws IOException
    {
        FileSystemProvider provider = provider(source);
        if (provider(target) == provider) {
            // same provider
            provider.move(source, target, options);
        } else {
            // different providers
            CopyMoveHelper.moveToForeignTarget(source, target, options);
        }
        return target;
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( path.toFile() ).isEqualTo( file );
    }

    @Test
    public void testAbsloluteSimpleToURIUnix() throws Exception {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( false );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "/" );

        final Path path = create( fs, "/path/to/file.txt", false );
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( uri.toString() ).isEqualTo( "file:///path/to/file.txt" );
    }

    @Test
    public void testAbsoluteToURIUnix() throws Exception {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( true );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "/" );

        final Path path = create( fs, "/path/to/file.txt", false );
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( realPath.toUri().toString() ).isEqualTo( "file:///path/to/file.txt" );
    }

    @Test
    public void testRelativeToURIUnix() throws Exception {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( true );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "/" );

        final Path path = create( fs, "path/to/file.txt", false );
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( path.toRealPath().toUri().toString() ).isEqualTo( "file://" + DEFAULT_PATH + "path/to/file.txt" );
    }

    @Test
    public void testAbsoluteToURIWindows() throws Exception {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( true );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "\\" );

        final Path path = create( fs, "c:\\path\\to\\file.txt", false );
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( realPath.toUri().toString() ).isEqualTo( "file:///c:/path/to/file.txt" );
    }

    @Test
    public void testRelativeToURIWindows() throws Exception {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( true );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "\\" );

        final Path path = create( fs, "path\\to\\file.txt", false );
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( path.toRealPath().toUri().toString() ).isEqualTo( "file:///" + "C:" + DEFAULT_PATH + "path/to/file.txt" );
    }

    @Test
    public void testResolve() {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( true );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "/" );

        final Path path = create( fs, "/path/to/", false );
View Full Code Here

Examples of org.uberfire.java.nio.file.spi.FileSystemProvider

        assertThat( resolvedPath5 ).isEqualTo( path2 );
    }

    @Test(expected = IllegalArgumentException.class)
    public void checkResolveNull() {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
        when( fsprovider.isDefault() ).thenReturn( true );
        when( fsprovider.getScheme() ).thenReturn( "file" );
        when( fs.provider() ).thenReturn( fsprovider );

        when( fs.getSeparator() ).thenReturn( "/" );

        final Path path = create( fs, "/path/to/", false );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.