Examples of fileKey()


Examples of java.nio.file.attribute.BasicFileAttributes.fileKey()

        if (depth >= maxDepth || !attrs.isDirectory()) {
            return new Event(EventType.ENTRY, entry, attrs);
        }

        // check for cycles when following links
        if (followLinks && wouldLoop(entry, attrs.fileKey())) {
            return new Event(EventType.ENTRY, entry,
                             new FileSystemLoopException(entry.toString()));
        }

        // file is a directory, attempt to open it
View Full Code Here

Examples of java.nio.file.attribute.BasicFileAttributes.fileKey()

                return null;
            throw se;
        }

        // push a directory node to the stack and return an event
        stack.push(new DirectoryNode(entry, attrs.fileKey(), stream));
        return new Event(EventType.START_DIRECTORY, entry, attrs);
    }


    /**
 
View Full Code Here

Examples of java.nio.file.attribute.BasicFileAttributes.fileKey()

    System.out.printf(">>> Directory? %s\n", basicAttributes.isDirectory());
    System.out.printf(">>> File? %s\n", basicAttributes.isRegularFile());
    System.out.printf(">>> Last accessed on: %s\n", basicAttributes.lastAccessTime());
    System.out.printf(">>> Last modified on: %s\n", basicAttributes.lastModifiedTime());
    System.out.printf(">>> File size (bytes): %s\n", basicAttributes.size());
    System.out.printf(">>> File key : %s\n", basicAttributes.fileKey());
    File tempDir = new File(System.getProperty("java.io.tmpdir"));
    Path tempDirPathRef = Paths.get(tempDir.toURI());
    Path p = null;
    Iterator<Path> tmpIter = null;
    System.out.printf("Files in directory '%s'\n", tempDir.getName());
View Full Code Here

Examples of java.nio.file.attribute.BasicFileAttributes.fileKey()

  public void testReadAttributes_asObject() {
    File file = Directory.create(0);
    service.setInitialAttributes(file);

    BasicFileAttributes basicAttrs = service.readAttributes(file, BasicFileAttributes.class);
    assertThat(basicAttrs.fileKey()).isEqualTo(0);
    assertThat(basicAttrs.isDirectory()).isTrue();
    assertThat(basicAttrs.isRegularFile()).isFalse();

    TestAttributes testAttrs = service.readAttributes(file, TestAttributes.class);
    assertThat(testAttrs.foo()).isEqualTo("hello");
View Full Code Here

Examples of java.nio.file.attribute.BasicFileAttributes.fileKey()

    assertThat(view).isNotNull();
    assertThat(view.name()).isEqualTo("basic");

    BasicFileAttributes attrs = view.readAttributes();
    assertThat(attrs.fileKey()).isEqualTo(0);

    FileTime time = attrs.creationTime();
    assertThat(attrs.lastAccessTime()).isEqualTo(time);
    assertThat(attrs.lastModifiedTime()).isEqualTo(time);
View Full Code Here

Examples of java.nio.file.attribute.BasicFileAttributes.fileKey()

  }

  @Test
  public void testAttributes() {
    BasicFileAttributes attrs = provider.readAttributes(file);
    assertThat(attrs.fileKey()).isEqualTo(0);
    assertThat(attrs.isDirectory()).isTrue();
    assertThat(attrs.isRegularFile()).isFalse();
    assertThat(attrs.creationTime()).isNotNull();
  }
}
View Full Code Here

Examples of java.nio.file.attribute.PosixFileAttributes.fileKey()

    assertThat(view.name()).isEqualTo("posix");
    assertThat(view.getOwner()).isEqualTo(createUserPrincipal("user"));

    PosixFileAttributes attrs = view.readAttributes();
    assertThat(attrs.fileKey()).isEqualTo(0);
    assertThat(attrs.owner()).isEqualTo(createUserPrincipal("user"));
    assertThat(attrs.group()).isEqualTo(createGroupPrincipal("group"));
    assertThat(attrs.permissions()).isEqualTo(PosixFilePermissions.fromString("rw-r--r--"));

    view.setOwner(createUserPrincipal("root"));
View Full Code Here

Examples of java.nio.file.attribute.PosixFileAttributes.fileKey()

  @Test
  public void testAttributes() {
    PosixFileAttributes attrs = provider.readAttributes(file);
    assertThat(attrs.permissions()).isEqualTo(PosixFilePermissions.fromString("rw-r--r--"));
    assertThat(attrs.group()).isEqualTo(createGroupPrincipal("group"));
    assertThat(attrs.fileKey()).isEqualTo(0);
  }
}
View Full Code Here

Examples of org.uberfire.java.nio.file.attribute.BasicFileAttributes.fileKey()

                return fileAttrs.size();
            }

            @Override
            public Object fileKey() {
                return fileAttrs.fileKey();
            }
        };
    }

    private Pair<Integer, Object> extractValue( final Map.Entry<String, Object> entry ) {
View Full Code Here

Examples of org.uberfire.java.nio.file.attribute.BasicFileAttributes.fileKey()

                return fileAttrs.size();
            }

            @Override
            public Object fileKey() {
                return fileAttrs.fileKey();
            }
        };
    }

    private Pair<Integer, Object> extractValue( final Map.Entry<String, Object> entry ) {
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.