Examples of SimpleFileSystemProvider


Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.createSymbolicLink( path, path2 );
    }

    @Test(expected = IllegalArgumentException.class)
    public void createLinkNull1() {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        fsProvider.createLink( null, null );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.createLink( null, null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void createLinkNull2() {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false );

        fsProvider.createLink( path, null );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.createLink( path, null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void createLinkNull3() {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false );

        fsProvider.createLink( null, path );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.createLink( null, path );
    }

    @Test(expected = IllegalStateException.class)
    public void createLinkSame() {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false );

        fsProvider.createLink( path, path );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.createLink( path, path );
    }

    @Test(expected = UnsupportedOperationException.class)
    public void createLinkUnsupportedOp() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();
        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false );

        final File tempFile = File.createTempFile( "foo", "bar" );
        final Path path2 = GeneralPathImpl.newFromFile( fsProvider.getFileSystem( URI.create( "file:///" ) ), tempFile );

        fsProvider.createLink( path, path2 );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.createLink( path, path2 );
    }

    @Test
    public void checkDelete() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final File tempFile = File.createTempFile( "foo", "bar" );
        final Path path = GeneralPathImpl.newFromFile( fsProvider.getFileSystem( URI.create( "file:///" ) ), tempFile );

        assertThat( path.toFile().exists() ).isTrue();
        fsProvider.delete( path );
        assertThat( path.toFile().exists() ).isFalse();
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        assertThat( path.toFile().exists() ).isFalse();
    }

    @Test(expected = NoSuchFileException.class)
    public void checkDeleteNonExistent() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false );

        assertThat( path.toFile().exists() ).isFalse();
        fsProvider.delete( path );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.delete( path );
    }

    @Test(expected = IllegalArgumentException.class)
    public void checkDeleteNull() {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        fsProvider.delete( null );
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        fsProvider.delete( null );
    }

    @Test
    public void checkDeleteIfExists() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final File tempFile = File.createTempFile( "foo", "bar" );
        final Path path = GeneralPathImpl.newFromFile( fsProvider.getFileSystem( URI.create( "file:///" ) ), tempFile );

        assertThat( path.toFile().exists() ).isTrue();
        assertThat( fsProvider.deleteIfExists( path ) ).isTrue();
        assertThat( path.toFile().exists() ).isFalse();
    }
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider

        assertThat( path.toFile().exists() ).isFalse();
    }

    @Test
    public void checkDeleteIfExistsNonExistent() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false );

        assertThat( path.toFile().exists() ).isFalse();
        assertThat( fsProvider.deleteIfExists( path ) ).isFalse();
        assertThat( path.toFile().exists() ).isFalse();
    }
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.