Package org.uberfire.java.nio.file

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


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

        assertThat( path.toFile().exists() ).isTrue();
        assertThat( path.toFile() ).isEqualTo( tempFile );

        fsProvider.newByteChannel( path, null );
    }

    @Test(expected = org.uberfire.java.nio.IOException.class)
View Full Code Here


        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final String userBasedPath = System.getProperty( "user.dir" ) + "path/to/some_file_here.txt";

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false );
        assertThat( path.toFile().exists() ).isFalse();

        fsProvider.newByteChannel( path, null );
    }

    @Test(expected = IllegalArgumentException.class)
View Full Code Here

        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final String userBasedPath = System.getProperty( "user.dir" ) + "/my_byte_some_file_here.txt";

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false );
        assertThat( path.toFile().exists() ).isFalse();

        final SeekableByteChannel channel = fsProvider.newByteChannel( path, null );

        assertThat( channel ).isNotNull();
        assertThat( path.toFile().exists() ).isTrue();
View Full Code Here

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

        final SeekableByteChannel channel = fsProvider.newByteChannel( path, null );

        assertThat( channel ).isNotNull();
        assertThat( path.toFile().exists() ).isTrue();

        assertThat( channel.isOpen() ).isTrue();

        channel.close();
View Full Code Here

//            channel.write( null );
//            fail( "method not implemented - exception expected!" );
//        } catch ( NotImplementedException ex ) {
//        }

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

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

//            fail( "method not implemented - exception expected!" );
//        } catch ( NotImplementedException ex ) {
//        }

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

    @Test
    public void checkCreateDirectory() {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();
View Full Code Here

        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();

        final String userBasedPath = System.getProperty( "user.dir" ) + "/temp";

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false );
        path.toFile().delete();
        assertThat( path.toFile().exists() ).isFalse();

        fsProvider.createDirectory( path );

        assertThat( path.toFile().exists() ).isTrue();
View Full Code Here

        final String userBasedPath = System.getProperty( "user.dir" ) + "/temp";

        final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false );
        path.toFile().delete();
        assertThat( path.toFile().exists() ).isFalse();

        fsProvider.createDirectory( path );

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

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

        fsProvider.createDirectory( path );

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

    @Test(expected = FileAlreadyExistsException.class)
View Full Code Here

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

        fsProvider.createDirectory( path );

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

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