Package org.uberfire.java.nio.file.attribute

Examples of org.uberfire.java.nio.file.attribute.BasicFileAttributes


    }

    private FileVisitResult walk(final Path file, final int depth)
            throws IOException {
        IOException exc = null;
        BasicFileAttributes attrs = null;
        try {
            attrs = Files.readAttributes(file, BasicFileAttributes.class);
        } catch (IOException ex) {
            exc = ex;
        }

        if (exc != null) {
            return visitor.visitFileFailed(file, exc);
        }

        // at maximum depth or file is not a directory
        if (depth >= maxDepth || !attrs.isDirectory()) {
            return visitor.visitFile(file, attrs);
        }

        DirectoryStream<? extends Path> stream = null;
        FileVisitResult result = null;
View Full Code Here


    @Test
    public void readAttributesBasic() throws IOException {
        final Path path = Files.createTempFile( "foo", "bar" );

        final BasicFileAttributes attrs = Files.readAttributes( path, BasicFileAttributes.class );

        assertThat( attrs ).isNotNull();
        assertThat( attrs.isRegularFile() ).isTrue();
        assertThat( attrs.isDirectory() ).isFalse();
        assertThat( attrs.isSymbolicLink() ).isFalse();
        assertThat( attrs.isOther() ).isFalse();
        assertThat( attrs.size() ).isEqualTo( 0L );
    }
View Full Code Here

TOP

Related Classes of org.uberfire.java.nio.file.attribute.BasicFileAttributes

Copyright © 2018 www.massapicom. 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.