@Override
  public void set(File file, String view, String attribute, Object value, boolean create) {
    switch (attribute) {
      case "creationTime":
        checkNotCreate(view, attribute, create);
        file.setCreationTime(checkType(view, attribute, value, FileTime.class));
        break;
      case "lastAccessTime":
        checkNotCreate(view, attribute, create);
        file.setLastAccessTime(checkType(view, attribute, value, FileTime.class));
        break;
      case "lastModifiedTime":
        checkNotCreate(view, attribute, create);
        file.setLastModifiedTime(checkType(view, attribute, value, FileTime.class));
        break;
      case "size":
      case "fileKey":
      case "isDirectory":
      case "isRegularFile":
      case "isSymbolicLink":
      case "isOther":
        throw unsettable(view, attribute, create);
      default:
    }
  }
@Test
  public void testSet() {
    FileTime time = FileTime.fromMillis(0L);

    // settable
    assertSetAndGetSucceeds("creationTime", time);
    assertSetAndGetSucceeds("lastModifiedTime", time);
    assertSetAndGetSucceeds("lastAccessTime", time);

    // unsettable
    assertSetFails("fileKey", 3L);
    assertSetFails("size", 1L);
    assertSetFails("isRegularFile", true);
    assertSetFails("isDirectory", true);
    assertSetFails("isSymbolicLink", true);
    assertSetFails("isOther", true);

    // invalid type
    assertSetFails("creationTime", "foo");
  }