Package org.uberfire.java.nio.file

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


    public void startsWith() {
        when( fs.getSeparator() ).thenReturn( "/" );

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

        assertTrue( path.startsWith( create( fs, "/path", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
View Full Code Here


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

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

        assertTrue( path.startsWith( create( fs, "/path", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
View Full Code Here

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

        assertTrue( path.startsWith( create( fs, "/path", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
        assertFalse( path.startsWith( create( fs, "to", false ) ) );
View Full Code Here

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

        assertTrue( path.startsWith( create( fs, "/path", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
        assertFalse( path.startsWith( create( fs, "to", false ) ) );
    }
View Full Code Here

        assertTrue( path.startsWith( create( fs, "/path", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
        assertFalse( path.startsWith( create( fs, "to", false ) ) );
    }
View Full Code Here

        assertTrue( path.startsWith( create( fs, "/path", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
        assertFalse( path.startsWith( create( fs, "to", false ) ) );
    }

    @Test
View Full Code Here

        assertTrue( path.startsWith( create( fs, "/path/to", false ) ) );
        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
        assertFalse( path.startsWith( create( fs, "to", false ) ) );
    }

    @Test
    public void endsWith() {
View Full Code Here

        assertTrue( path.startsWith( create( fs, "/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/p/th/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "/some/other/path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to/file.txt", false ) ) );
        assertFalse( path.startsWith( create( fs, "path/to", false ) ) );
        assertFalse( path.startsWith( create( fs, "to", false ) ) );
    }

    @Test
    public void endsWith() {
        when( fs.getSeparator() ).thenReturn( "/" );
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void startsWith() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
        path.startsWith((String) null);
    }

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

    }

    @Test(expected = IllegalArgumentException.class)
    public void startsWithPath() {
        final Path path = GeneralPathImpl.create(fs, "/path/to/file.txt", false);
        path.startsWith((Path) null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void endsWith() {
        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.