Examples of newByteChannel()


Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider.newByteChannel()

        final String userBasedPath = System.getProperty( "user.dir" ) + "/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();
        path.toFile().delete();
        assertThat( path.toFile().exists() ).isFalse();
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider.newByteChannel()

        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)
    public void newByteChannelInvalidPath() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider.newByteChannel()

        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)
    public void newByteChannelNull() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider.newByteChannel()

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

        fsProvider.newByteChannel( null, null );
    }

    @Test(expected = UnsupportedOperationException.class)
    public void newAsynchronousFileChannelUnsupportedOp() throws IOException {
        final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider();
View Full Code Here

Examples of org.uberfire.java.nio.fs.file.SimpleFileSystemProvider.newByteChannel()

        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();

        assertThat( channel.isOpen() ).isTrue();
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.