Package org.uberfire.java.nio.file

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


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

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

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
View Full Code Here


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

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

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "/to" );
View Full Code Here

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

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

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "/to" );
View Full Code Here

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "/to" );
        assertThat( path2.normalize().normalize() ).isNotNull().isEqualTo( path2.normalize() );
    }

    @Test
View Full Code Here

        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "/to" );
        assertThat( path2.normalize().normalize() ).isNotNull().isEqualTo( path2.normalize() );
    }

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

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "/to" );
        assertThat( path2.normalize().normalize() ).isNotNull().isEqualTo( path2.normalize() );
    }

    @Test
    public void testNormalizeWindows() {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
View Full Code Here

        final Path path2 = create( fs, "/some/path/../../to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "/to" );
        assertThat( path2.normalize().normalize() ).isNotNull().isEqualTo( path2.normalize() );
    }

    @Test
    public void testNormalizeWindows() {
        final FileSystemProvider fsprovider = mock( FileSystemProvider.class );
View Full Code Here

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

        final Path path = create( fs, "c:\\path\\to\\", false );

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "c:\\some\\path\\..\\..\\to", false );

        assertThat( path2.normalize() ).isNotNull();
View Full Code Here

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

        final Path path = create( fs, "c:\\path\\to\\", false );

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "c:\\some\\path\\..\\..\\to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "c:\\to" );
View Full Code Here

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

        final Path path = create( fs, "c:\\path\\to\\", false );

        assertThat( path.normalize() ).isNotNull().isEqualTo( path );
        assertThat( path.normalize().normalize() ).isNotNull().isEqualTo( path.normalize() );

        final Path path2 = create( fs, "c:\\some\\path\\..\\..\\to", false );

        assertThat( path2.normalize() ).isNotNull();
        assertThat( path2.normalize().toString() ).isEqualTo( "c:\\to" );
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.