Package java.nio.file

Examples of java.nio.file.FileStore.type()


    System.out.printf("Owner of file '%s' is '%s'\n", filePathRef.toFile().getName(), owner.getName());
    FileStore store = Files.getFileStore(filePathRef);
    System.out.println("Storage infos");
    System.out.printf(">>> Store name is '%s'\n", store.name());
    System.out.printf(">>> Store is read-only '%s'\n", store.isReadOnly());
    System.out.printf(">>> Store type is '%s'\n", store.type());
    String fileContentType = Files.probeContentType(filePathRef);
    System.out.printf("File '%s' content type is '%s'\n", f.getName(), fileContentType);
    List<String> content = Files.readAllLines(filePathRef, Charset.defaultCharset());
    System.out.printf("File '%s' content is '%s'\n", f.getName(), content);
    BasicFileAttributes basicAttributes = Files.readAttributes(filePathRef, BasicFileAttributes.class);
View Full Code Here


  @Test
  public void testFileStore() throws IOException {
    FileStore fileStore = Iterables.getOnlyElement(fs.getFileStores());
    assertThat(fileStore.name()).isEqualTo("jimfs");
    assertThat(fileStore.type()).isEqualTo("jimfs");
    assertThat(fileStore.isReadOnly()).isFalse();

    long totalSpace = 1024 * 1024 * 1024; // 1 GB
    assertThat(fileStore.getTotalSpace()).isEqualTo(totalSpace);
    assertThat(fileStore.getUnallocatedSpace()).isEqualTo(totalSpace);
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.