@Test public void testView() throws IOException { AclFileAttributeView view = provider.view( fileLookup(), ImmutableMap.<String, FileAttributeView>of( "owner", new OwnerAttributeProvider().view(fileLookup(), NO_INHERITED_VIEWS))); assertNotNull(view); assertThat(view.name()).isEqualTo("acl"); assertThat(view.getAcl()).isEqualTo(defaultAcl); view.setAcl(ImmutableList.<AclEntry>of()); view.setOwner(FOO); assertThat(view.getAcl()).isEqualTo(ImmutableList.<AclEntry>of()); assertThat(view.getOwner()).isEqualTo(FOO); assertThat(file.getAttribute("acl", "acl")).isEqualTo(ImmutableList.<AclEntry>of()); }
@Override public AclFileAttributeView view( FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews) { return new View(lookup, (FileOwnerAttributeView) inheritedViews.get("owner")); }
AclAttributeProvider extends AttributeProvider { @Override public AclFileAttributeView view( FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews) { return new View(lookup, (FileOwnerAttributeView) inheritedViews.get("owner")); } }
AclAttributeProvider extends AttributeProvider { @Override public AclFileAttributeView view( FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews) { return new View(lookup, (FileOwnerAttributeView) inheritedViews.get("owner")); }  }
AclAttributeProvider extends AttributeProvider { @Override public AclFileAttributeView view( FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews) { return new View(lookup, (FileOwnerAttributeView) inheritedViews.get("owner")); }  @Override String name(); @Override ImmutableSet<String> inherits(); @Override ImmutableSet<String> fixedAttributes(); @Override ImmutableMap<String, ?> defaultValues(Map<String, ?> userProvidedDefaults); @NullableDecl @Override Object get(File file, String attribute); @Override void set(File file, String view, String attribute, Object value, boolean create); @Override Class<AclFileAttributeView> viewType(); @Override AclFileAttributeView view(
      FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews); }
AclAttributeProvider extends AttributeProvider { @Override public AclFileAttributeView view( FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews) { return new View(lookup, (FileOwnerAttributeView) inheritedViews.get("owner")); }  @Override String name(); @Override ImmutableSet<String> inherits(); @Override ImmutableSet<String> fixedAttributes(); @Override ImmutableMap<String, ?> defaultValues(Map<String, ?> userProvidedDefaults); @NullableDecl @Override Object get(File file, String attribute); @Override void set(File file, String view, String attribute, Object value, boolean create); @Override Class<AclFileAttributeView> viewType(); @Override AclFileAttributeView view(
      FileLookup lookup, ImmutableMap<String, FileAttributeView> inheritedViews);  }