@SuppressWarnings("unchecked")
  public <A extends BasicFileAttributes> A readAttributes(File file, Class<A> type) {
    AttributeProvider provider = providersByAttributesType.get(type);
    if (provider != null) {
      return (A) provider.readAttributes(file);
    }

    throw new UnsupportedOperationException("unsupported attributes type: " + type);
  }
Returns attributes of the given file as an object of the given type.

@throws UnsupportedOperationException if the given attributes type is not supported
jimfs/src/main/java/com/google/common/jimfs/AttributeService.java