Tabnine Logo
AccessControlList.getEntries
Code IndexAdd Tabnine to your IDE (free)

How to use
getEntries
method
in
alluxio.security.authorization.AccessControlList

Best Java code snippets using alluxio.security.authorization.AccessControlList.getEntries (Showing top 7 results out of 315)

origin: Alluxio/alluxio

/**
 * @return the list of string entries
 */
public List<String> toStringEntries() {
 List<String> entries = new ArrayList<>();
 for (AclEntry entry : getEntries()) {
  entries.add(entry.toCliString());
 }
 return entries;
}
origin: Alluxio/alluxio

/**
 * Returns a list of {@link AclEntry} which represent this ACL instance. The mask will only be
 * included if extended ACL entries exist.
 *
 * @return an immutable list of ACL entries
 */
@Override
public List<AclEntry> getEntries() {
 if (isEmpty()) {
  return new ArrayList<>();
 }
 List<AclEntry> aclEntryList = super.getEntries();
 for (AclEntry entry : aclEntryList) {
  entry.setDefault(true);
 }
 return aclEntryList;
}
origin: Alluxio/alluxio

@Override
public OutputStream createDirect(String path, CreateOptions options) throws IOException {
 IOException te = null;
 FileSystem hdfs = getFs();
 RetryPolicy retryPolicy = new CountingRetry(MAX_TRY);
 while (retryPolicy.attempt()) {
  try {
   // TODO(chaomin): support creating HDFS files with specified block size and replication.
   OutputStream outputStream = new HdfsUnderFileOutputStream(
     FileSystem.create(hdfs, new Path(path),
     new FsPermission(options.getMode().toShort())));
   if (options.getAcl() != null) {
    setAclEntries(path, options.getAcl().getEntries());
   }
   return outputStream;
  } catch (IOException e) {
   LOG.warn("Attempt count {} : {} ", retryPolicy.getAttemptCount(), e.getMessage());
   te = e;
  }
 }
 throw te;
}
origin: Alluxio/alluxio

private void setUfsAcl(LockedInodePath inodePath)
  throws InvalidPathException, AccessControlException {
 Inode inode = inodePath.getInodeOrNull();
 checkUfsMode(inodePath.getUri(), OperationType.WRITE);
 MountTable.Resolution resolution = mMountTable.resolve(inodePath.getUri());
 String ufsUri = resolution.getUri().toString();
 try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) {
  UnderFileSystem ufs = ufsResource.get();
  if (ufs.isObjectStorage()) {
   LOG.warn("SetACL is not supported to object storage UFS via Alluxio. "
     + "UFS: " + ufsUri + ". This has no effect on the underlying object.");
  } else {
   try {
    List<AclEntry> entries = new ArrayList<>(inode.getACL().getEntries());
    if (inode.isDirectory()) {
     entries.addAll(inode.asDirectory().getDefaultACL().getEntries());
    }
    ufs.setAclEntries(ufsUri, entries);
   } catch (IOException e) {
    throw new AccessControlException("Could not setAcl for UFS file: " + ufsUri);
   }
  }
 }
}
origin: Alluxio/alluxio

@Test
public void removeExtendedAclMask() throws Exception {
 mFileSystemMaster.createDirectory(NESTED_URI, CreateDirectoryContext
   .defaults(CreateDirectoryPOptions.newBuilder().setRecursive(true)));
 AclEntry newAcl = AclEntry.fromCliString("user:newuser:rwx");
 // Add an ACL
 addAcl(NESTED_URI, newAcl);
 assertThat(getInfo(NESTED_URI).getAcl().getEntries(), hasItem(newAcl));
 // Attempt to remove the ACL mask
 AclEntry maskEntry = AclEntry.fromCliString("mask::rwx");
 assertThat(getInfo(NESTED_URI).getAcl().getEntries(), hasItem(maskEntry));
 try {
  removeAcl(NESTED_URI, maskEntry);
  fail("Expected removing the mask from an extended ACL to fail");
 } catch (IOException e) {
  assertThat(e.getMessage(), containsString("mask"));
 }
 // Remove the extended ACL
 removeAcl(NESTED_URI, newAcl);
 // Now we can add and remove a mask
 addAcl(NESTED_URI, maskEntry);
 removeAcl(NESTED_URI, maskEntry);
}
origin: Alluxio/alluxio

createFileContext.setAcl(acl.getEntries());
origin: Alluxio/alluxio

  .setUfsStatus(context.getUfsStatus());
if (acl != null) {
 createDirectoryContext.setAcl(acl.getEntries());
alluxio.security.authorizationAccessControlListgetEntries

Javadoc

Returns a list of AclEntry which represent this ACL instance. The mask will only be included if extended ACL entries exist.

Popular methods of AccessControlList

  • <init>
    Creates a new instance where owning user and owning group are initialized to empty strings, and no a
  • getOwningGroup
  • getOwningUser
  • hasExtended
  • setEntry
    Sets an entry into the access control list. If an entry with the same type and subject already exist
  • setOwningGroup
    Sets owning group.
  • setOwningUser
    Sets owning user.
  • getMode
  • getPermission
    Gets the permitted actions for a user. When AccessControlList is not modified after calling getPermi
  • setMode
    Sets permitted actions for owning user, owning group, and other based on the mode. The format of mod
  • toString
  • toStringEntries
  • toString,
  • toStringEntries,
  • checkPermission,
  • clearEntries,
  • fromStringEntries,
  • getOtherActions,
  • getOwningGroupActions,
  • getOwningUserActions,
  • removeEntry

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Permission (java.security)
    Legacy security code; do not use.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now