Package org.uberfire.java.nio.file

Examples of org.uberfire.java.nio.file.Path.subpath()


        assertThat( path.subpath( 0, 2 ) ).isNotNull();
        assertThat( path.subpath( 0, 2 ).toString() ).isEqualTo( "path/to" );

        assertThat( path.subpath( 1, 3 ) ).isNotNull();
        assertThat( path.subpath( 1, 3 ).toString() ).isEqualTo( "to/file.txt" );

        int i = 0;
        for ( final Path currentPath : path ) {
            assertThat( currentPath ).isEqualTo( path.getName( i ) );
            i++;
View Full Code Here


        assertThat( path.getName( 1 ) ).isNotNull();
        assertThat( path.getName( 1 ).toString() ).isEqualTo( "to" );

        assertThat( path.getName( 2 ) ).isNotNull().isEqualTo( path.getFileName() );

        assertThat( path.subpath( 0, 1 ) ).isNotNull();
        assertThat( path.subpath( 0, 1 ).toString() ).isEqualTo( "path" );

        assertThat( path.subpath( 1, 2 ) ).isNotNull();
        assertThat( path.subpath( 1, 2 ).toString() ).isEqualTo( "to" );
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange1() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
        path.subpath(-1, 1);
    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange2() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange2() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
        path.subpath(5, 7);
    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange3() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange3() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
        path.subpath(0, 7);
    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange4() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void subpathInvaligRange4() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
        path.subpath(2, 1);
    }

    @Test(expected = IllegalArgumentException.class)
    public void startsWith() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", 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.