Tabnine Logo
FileInfo.getMode
Code IndexAdd Tabnine to your IDE (free)

How to use
getMode
method
in
alluxio.wire.FileInfo

Best Java code snippets using alluxio.wire.FileInfo.getMode (Showing top 11 results out of 315)

origin: Alluxio/alluxio

/**
 * @return the int representation of the ACL mode bits of the entity referenced by this uri,
 *         mutable
 */
public int getMode() {
 return mInfo.getMode();
}
origin: Alluxio/alluxio

  CreateOptions.defaults(ServerConfiguration.global())
  .setOwner(fileInfo.getOwner()).setGroup(fileInfo.getGroup())
  .setMode(new Mode((short) fileInfo.getMode())));
final WritableByteChannel outputChannel = Channels.newChannel(outputStream);
List<Throwable> errors = new ArrayList<>();
origin: Alluxio/alluxio

/**
 * Tests the permission bits are 0777 for directories and 0666 for files with UMASK 000.
 */
@Test
public void permission() throws Exception {
 mFileSystemMaster.createFile(NESTED_FILE_URI, mNestedFileContext);
 assertEquals(0777,
   mFileSystemMaster.getFileInfo(NESTED_URI, GET_STATUS_CONTEXT).getMode());
 assertEquals(0666,
   mFileSystemMaster.getFileInfo(NESTED_FILE_URI, GET_STATUS_CONTEXT).getMode());
}
origin: Alluxio/alluxio

@Test
public void setPermissionSuccess() throws Exception {
 // super user
 verifySetAcl(TEST_USER_ADMIN, TEST_FILE_URI, null, null, (short) 0600, false);
 // super group
 verifySetAcl(TEST_USER_SUPERGROUP, TEST_DIR_URI, null, null, (short) 0700, true);
 FileInfo fileInfo = mFileSystemMaster
   .getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(TEST_DIR_FILE_URI)));
 assertEquals((short) 0700, fileInfo.getMode());
 // owner enlarge the permission
 verifySetAcl(TEST_USER_1, TEST_DIR_URI, null, null, (short) 0777, true);
 fileInfo = mFileSystemMaster
   .getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(TEST_DIR_FILE_URI)));
 assertEquals((short) 0777, fileInfo.getMode());
 // other user can operate under this enlarged permission
 verifyCreateFile(TEST_USER_2, TEST_DIR_URI + "/newFile", false);
 verifyDelete(TEST_USER_2, TEST_DIR_FILE_URI, false);
}
origin: Alluxio/alluxio

 private void assertFileInfoEqualsFileStatus(FileInfo info, FileStatus status) {
  assertEquals(info.getOwner(), status.getOwner());
  assertEquals(info.getGroup(), status.getGroup());
  assertEquals(info.getMode(), status.getPermission().toShort());
  assertEquals(info.getLastModificationTimeMs(), status.getModificationTime());
  assertEquals(info.isFolder(), status.isDir());
 }
}
origin: Alluxio/alluxio

@Test
public void setAclSuccess() throws Exception {
 // super user sets owner, group, and permission
 verifySetAcl(TEST_USER_ADMIN, TEST_FILE_URI, TEST_USER_1.getUser(), TEST_USER_1.getGroup(),
   (short) 0600, false);
 // owner sets group and permission
 verifySetAcl(TEST_USER_1, TEST_DIR_URI, null, TEST_USER_2.getGroup(), (short) 0777, true);
 FileInfo fileInfo = mFileSystemMaster
   .getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(TEST_DIR_FILE_URI)));
 assertEquals(TEST_USER_2.getGroup(), fileInfo.getGroup());
 assertEquals((short) 0777, fileInfo.getMode());
}
origin: Alluxio/alluxio

.addAllBlockIds(fileInfo.getBlockIds())
.setLastModificationTimeMs(fileInfo.getLastModificationTimeMs()).setTtl(fileInfo.getTtl())
.setOwner(fileInfo.getOwner()).setGroup(fileInfo.getGroup()).setMode(fileInfo.getMode())
.setPersistenceState(fileInfo.getPersistenceState()).setMountPoint(fileInfo.isMountPoint())
.addAllFileBlockInfos(fileBlockInfos)
origin: Alluxio/alluxio

private void verifySetAcl(TestUser runUser, String path, String owner, String group,
  short mode, boolean recursive) throws Exception {
 try (Closeable r = new AuthenticatedUserRule(runUser.getUser(),
   ServerConfiguration.global()).toResource()) {
  SetAttributeContext context = SetAttributeContext.defaults(SetAttributePOptions.newBuilder()
    .setMode(new Mode(mode).toProto()).setRecursive(recursive));
  if (owner != null) {
   context.getOptions().setOwner(owner);
  }
  if (group != null) {
   context.getOptions().setGroup(group);
  }
  mFileSystemMaster.setAttribute(new AlluxioURI(path), context);
 }
 try (Closeable r = new AuthenticatedUserRule(TEST_USER_ADMIN.getUser(),
   ServerConfiguration.global()).toResource()) {
  FileInfo fileInfo =
    mFileSystemMaster.getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(path)));
  if (owner != null) {
   assertEquals(owner, fileInfo.getOwner());
  }
  if (group != null) {
   assertEquals(group, fileInfo.getGroup());
  }
  if (mode != -1) {
   assertEquals(mode, fileInfo.getMode());
  }
 }
}
origin: Alluxio/alluxio

Assert.assertEquals(a.getLastModificationTimeMs(), b.getLastModificationTimeMs());
Assert.assertEquals(a.getLength(), b.getLength());
Assert.assertEquals(a.getMode(), b.getMode());
Assert.assertEquals(a.getName(), b.getName());
Assert.assertEquals(a.getOwner(), b.getOwner());
origin: org.alluxio/alluxio-core-common

/**
 * @return the int representation of the ACL mode bits of the entity referenced by this uri,
 *         mutable
 */
public int getMode() {
 return mInfo.getMode();
}
origin: Alluxio/alluxio

Assert.assertEquals(uriStatus.getName(), fileInfo.getName());
Assert.assertEquals(uriStatus.getPath(), fileInfo.getPath());
Assert.assertEquals(uriStatus.getMode(), fileInfo.getMode());
Assert.assertEquals(uriStatus.getPersistenceState(),
  fileInfo.getPersistenceState());
alluxio.wireFileInfogetMode

Popular methods of FileInfo

  • <init>
    Creates a new instance of FileInfo.
  • getPath
  • isFolder
  • setFileBlockInfos
  • getGroup
  • getLastModificationTimeMs
  • getLength
  • getName
  • getOwner
  • getUfsPath
  • isCompleted
  • setBlockIds
  • isCompleted,
  • setBlockIds,
  • setFolder,
  • setLength,
  • setPath,
  • getBlockIds,
  • getBlockSizeBytes,
  • getCreationTimeMs,
  • getFileId

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • getExternalFilesDir (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top Vim plugins
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