Create an immutable {@link FsPermission} object.
543080
public static FsPermission createImmutable(short permission) {
    return new FsPermission(permission) {
      public FsPermission applyUMask(FsPermission umask) {
        throw new UnsupportedOperationException();
      }
      public void readFields(DataInput in) throws IOException {
        throw new UnsupportedOperationException();
      }
    };
  }
470998
public static FileSystem createInstance(
      Configuration config, Path workingDirectory, Collection<FileStatus> fileStatuses) {
    checkNotNull(config, "configuration can not be null");

    FileSystem fileSystem = new InMemoryGlobberFileSystem(workingDirectory, fileStatuses);
    fileSystem.setConf(config);

    return fileSystem;
  }
68856
protected final PrcEntityFfolSave<RS, IHasId<Object>, Object>
    createPutPrcEntityFfolSave(
      final Map<String, Object> pAddParam) throws Exception {
    @SuppressWarnings("unchecked")
    PrcEntityFfolSave<RS, IHasId<Object>, Object> proc =
      (PrcEntityFfolSave<RS, IHasId<Object>, Object>)
        this.fctBnEntitiesProcessors
          .lazyGet(pAddParam, PrcEntityFfolSave.class.getSimpleName());
    //assigning fully initialized object:
    this.processorsMap.put(PrcEntityFfolSave.class.getSimpleName(), proc);
    return proc;
  }
1094110
public static S3RecoverableWriter writer(
			final FileSystem fs,
			final FunctionWithException<File, RefCountedFile, IOException> tempFileCreator,
			final S3AccessHelper s3AccessHelper,
			final Executor uploadThreadPool,
			final long userDefinedMinPartSize,
			final int maxConcurrentUploadsPerStream) {

		checkArgument(userDefinedMinPartSize >= S3_MULTIPART_MIN_PART_SIZE);

		final S3RecoverableMultipartUploadFactory uploadFactory =
				new S3RecoverableMultipartUploadFactory(
						fs,
						s3AccessHelper,
						maxConcurrentUploadsPerStream,
						uploadThreadPool,
						tempFileCreator);

		return new S3RecoverableWriter(s3AccessHelper, uploadFactory, tempFileCreator, userDefinedMinPartSize);
	}
589493
public static void setPermissions(Path location, Optional<String> owner, Optional<String> group, FileSystem fs,
      FsPermission permission) {
    try {
      if (!owner.isPresent()) {
        return;
      }
      if (!group.isPresent()) {
        return;
      }
      fs.setOwner(location, owner.get(), group.get());
      fs.setPermission(location, permission);
      if (!fs.isDirectory(location)) {
        return;
      }
      for (FileStatus fileStatus : fs.listStatus(location)) {
        setPermissions(fileStatus.getPath(), owner, group, fs, permission);
      }
    } catch (IOException e) {
      log.warn("Exception occurred while trying to change permissions : " + e.getMessage());
    }
  }
993614
def create(fs, channels, application):
    """"""

    result_code = ctypes.c_int()

    result = _create(fs, channels, application, ctypes.byref(result_code))
    if result_code.value is not constants.OK:
        raise OpusError(result_code.value)

    return result
931589
public static Writable newInstance(Class<? extends Writable> c,
      Configuration conf) {
    return newInstance(c, conf, true);
  }
19766
protected void createTransmissionDestination(SIBUuid8 remoteMEUuid) throws SIResourceException, SIMPDestinationAlreadyExistsException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createTransmissionDestination", remoteMEUuid);
        String destinationName = remoteMEUuid.toString();
        DestinationDefinition destinationDefinition;

        destinationDefinition = messageProcessor.createDestinationDefinition(DestinationType.QUEUE, destinationName);
        destinationDefinition.setMaxReliability(Reliability.ASSURED_PERSISTENT);
        destinationDefinition.setDefaultReliability(Reliability.ASSURED_PERSISTENT);
        Set<String> destinationLocalizingSet = new HashSet<String>();
        destinationLocalizingSet.add(messageProcessor.getMessagingEngineUuid().toString());

        // Create the transmission destination
        createDestinationLocalization(
                                      destinationDefinition,
                                      messageProcessor.createLocalizationDefinition(destinationDefinition.getName()),
                                      destinationLocalizingSet,
                                      false);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createTransmissionDestination");
    }
1161520
private void initializeStaticPolicy(List<ProGradePolicyEntry> grantEntriesList) throws Exception {

        // grant codeBase "file:${{java.ext.dirs}}/*" {
        // permission java.security.AllPermission;
        // };
        ProGradePolicyEntry p1 = new ProGradePolicyEntry(true, debug);
        Certificate[] certificates = null;
        URL url = new URL(expandStringWithProperty("file:${{java.ext.dirs}}/*"));
        CodeSource cs = new CodeSource(adaptURL(url), certificates);
        p1.setCodeSource(cs);
        p1.addPermission(new AllPermission());
        grantEntriesList.add(p1);

        // grant {
        // permission java.lang.RuntimePermission "stopThread";
        // permission java.net.SocketPermission "localhost:1024-", "listen";
        // permission java.util.PropertyPermission "java.version", "read";
        // permission java.util.PropertyPermission "java.vendor", "read";
        // permission java.util.PropertyPermission "java.vendor.url", "read";
        // permission java.util.PropertyPermission "java.class.version", "read";
        // permission java.util.PropertyPermission "os.name", "read";
        // permission java.util.PropertyPermission "os.version", "read";
        // permission java.util.PropertyPermission "os.arch", "read";
        // permission java.util.PropertyPermission "file.separator", "read";
        // permission java.util.PropertyPermission "path.separator", "read";
        // permission java.util.PropertyPermission "line.separator", "read";
        // permission java.util.PropertyPermission "java.specification.version", "read";
        // permission java.util.PropertyPermission "java.specification.vendor", "read";
        // permission java.util.PropertyPermission "java.specification.name", "read";
        // permission java.util.PropertyPermission "java.vm.specification.version", "read";
        // permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
        // permission java.util.PropertyPermission "java.vm.specification.name", "read";
        // permission java.util.PropertyPermission "java.vm.version", "read";
        // permission java.util.PropertyPermission "java.vm.vendor", "read";
        // permission java.util.PropertyPermission "java.vm.name", "read";
        // };
        ProGradePolicyEntry p2 = new ProGradePolicyEntry(true, debug);
        p2.addPermission(new RuntimePermission("stopThread"));
        p2.addPermission(new SocketPermission("localhost:1024-", "listen"));
        p2.addPermission(new PropertyPermission("java.version", "read"));
        p2.addPermission(new PropertyPermission("java.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.vendor.url", "read"));
        p2.addPermission(new PropertyPermission("java.class.version", "read"));
        p2.addPermission(new PropertyPermission("os.name", "read"));
        p2.addPermission(new PropertyPermission("os.version", "read"));
        p2.addPermission(new PropertyPermission("os.arch", "read"));
        p2.addPermission(new PropertyPermission("file.separator", "read"));
        p2.addPermission(new PropertyPermission("path.separator", "read"));
        p2.addPermission(new PropertyPermission("line.separator", "read"));
        p2.addPermission(new PropertyPermission("java.specification.version", "read"));
        p2.addPermission(new PropertyPermission("java.specification.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.specification.name", "read"));
        p2.addPermission(new PropertyPermission("java.vm.specification.version", "read"));
        p2.addPermission(new PropertyPermission("java.vm.specification.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.vm.specification.name", "read"));
        p2.addPermission(new PropertyPermission("java.vm.version", "read"));
        p2.addPermission(new PropertyPermission("java.vm.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.vm.name", "read"));
        grantEntriesList.add(p2);

    }
1109246
public static void serializeWriterDirPermissions(State state, int numBranches, int branchId,
      FsPermission fsPermissions) {
    serializeFsPermissions(state,
        ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_DIR_PERMISSIONS, numBranches, branchId),
        fsPermissions);
  }
378560
public FSDataOutputStream create(Path f) throws IOException {
    return create(f, CreateOptions.writeOptions(true, null));
  }
39111
private FSPermissionChecker checkPermission(String path, INode[] inodes, boolean doCheckOwner,
                                              FsAction ancestorAccess, FsAction parentAccess, FsAction access,
                                              FsAction subAccess)
    throws AccessControlException {
    boolean permissionCheckFailed = false;
    FSPermissionChecker pc = new FSPermissionChecker(
      fsOwner.getUserName(), supergroup, this.getCurrentUGI());
    if (!pc.isSuper) {
      dir.waitForReady();
      readLock();
      try {
        pc.checkPermission(path, inodes, doCheckOwner,
          ancestorAccess, parentAccess, access, subAccess);
      } catch (AccessControlException e) {
        if (!this.permissionAuditOnly) {
          throw e;
        }
        permissionCheckFailed = true;
      } finally {
        readUnlock();
      }
    }
    if (permissionCheckFailed) {
      // do not throw the exception, we would like to only log.
      LOG.warn("PermissionAudit failed on " + path +
        " checkOwner:" + doCheckOwner +
        " ancestor:" + ancestorAccess +
        " parent:" + parentAccess +
        " access:" + access +
        " subaccess:" + subAccess);
    }
    return pc;
  }
110047
def make_writeable(filename):
    
    if not os.access(filename, os.W_OK):
        st = os.stat(filename)
        new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
        os.chmod(filename, new_permissions)
439264
public boolean mkdirs(Path f, FsPermission permission) throws IOException {
    try (Closeable context = new TimerContextWithLog(mkdirTimer.time(), "mkdirs", f, permission)) {
      return super.mkdirs (f, permission);
    }
  }
298070
private void processPermission(DataInputStream in, ImageVisitor v)
      throws IOException {
    v.visitEnclosingElement(ImageElement.PERMISSIONS);
    v.visit(ImageElement.USER_NAME, Text.readStringOpt(in));
    v.visit(ImageElement.GROUP_NAME, Text.readStringOpt(in));
    FsPermission fsp = new FsPermission(in.readShort());
    v.visit(ImageElement.PERMISSION_STRING, fsp.toString());
    v.leaveEnclosingElement(); // Permissions
  }
84963
def create(cls, fpath):
        ""
        fpath = _expand_path(fpath)
        assert(fpath.suffix == '.yml')
        if fpath.exists(): return
        fpath.parent.mkdir(parents=True, exist_ok=True)
        with open(fpath, 'w') as yaml_file:
            yaml.dump(cls.DEFAULT_CONFIG, yaml_file, default_flow_style=False)
1090851
public static void serializeWriterFilePermissions(State state, int numBranches, int branchId,
      FsPermission fsPermissions) {
    serializeFsPermissions(state,
        ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PERMISSIONS, numBranches, branchId),
        fsPermissions);
  }