private List<AclEntry> getAclEntryList(String path) throws IOException { long id = lookup(path); FsImageProto.INodeSection.INode inode = fromINodeId(id); switch (inode.getType()) { case FILE: { FsImageProto.INodeSection.INodeFile f = inode.getFile(); return FSImageFormatPBINode.Loader.loadAclEntries( f.getAcl(), stringTable); } case DIRECTORY: { FsImageProto.INodeSection.INodeDirectory d = inode.getDirectory(); return FSImageFormatPBINode.Loader.loadAclEntries( d.getAcl(), stringTable); } default: { return new ArrayList<AclEntry>(); } } }
private PermissionStatus getPermissionStatus(String path) throws IOException { long id = lookup(path); FsImageProto.INodeSection.INode inode = fromINodeId(id); switch (inode.getType()) { case FILE: { FsImageProto.INodeSection.INodeFile f = inode.getFile(); return FSImageFormatPBINode.Loader.loadPermission( f.getPermission(), stringTable); } case DIRECTORY: { FsImageProto.INodeSection.INodeDirectory d = inode.getDirectory(); return FSImageFormatPBINode.Loader.loadPermission( d.getPermission(), stringTable); } case SYMLINK: { FsImageProto.INodeSection.INodeSymlink s = inode.getSymlink(); return FSImageFormatPBINode.Loader.loadPermission( s.getPermission(), stringTable); } default: { return null; } } }
private List<XAttr> getXAttrList(String path) throws IOException { long id = lookup(path); FsImageProto.INodeSection.INode inode = fromINodeId(id); switch (inode.getType()) { case FILE: return FSImageFormatPBINode.Loader.loadXAttrs( inode.getFile().getXAttrs(), stringTable); case DIRECTORY: return FSImageFormatPBINode.Loader.loadXAttrs(inode.getDirectory() .getXAttrs(), stringTable); default: return null; } }
private void dumpAcls(AclFeatureProto aclFeatureProto) { ImmutableList<AclEntry> aclEntryList = FSImageFormatPBINode.Loader .loadAclEntries(aclFeatureProto, stringTable); if (aclEntryList.size() > 0) { out.print("<acls>"); for (AclEntry aclEntry : aclEntryList) { o("acl", aclEntry.toString()); } out.print("</acls>"); } }
protected PermissionStatus getPermission(long perm) { return FSImageFormatPBINode.Loader.loadPermission(perm, stringTable); }
private String dumpPermission(long permission) { return FSImageFormatPBINode.Loader.loadPermission(permission, stringTable) .toString(); }