Gets the file / directory creation umask.

@param confUmask the string representation of umask
@return the umask {@link Mode}
499982
public static Mode getUMask(@Nullable String confUmask) {
    int umask = Constants.DEFAULT_FILE_SYSTEM_UMASK;
    if (confUmask != null) {
      if ((confUmask.length() > 4) || !isValid(confUmask)) {
        throw new IllegalArgumentException(ExceptionMessage.INVALID_CONFIGURATION_VALUE
            .getMessage(confUmask, PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK));
      }
      int newUmask = 0;
      int lastIndex = confUmask.length() - 1;
      for (int i = 0; i <= lastIndex; i++) {
        newUmask += (confUmask.charAt(i) - '0') << 3 * (lastIndex - i);
      }
      umask = newUmask;
    }
    return new Mode((short) umask);
  }
322264
public static URI getDefaultUri(Configuration conf) {
    return URI.create(fixName(conf.get(FS_DEFAULT_NAME_KEY, "file:///")));
  }
35964
private static String getContextRootPath(CmsObject cms, String creationSitemap) {

        String path = null;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(creationSitemap)) {
            try {
                path = cms.readFolder(creationSitemap).getRootPath();
            } catch (CmsException e) {
                LOG.warn("The provided creation sitemap " + creationSitemap + " is not a VFS folder.", e);
            }
        }
        if (path == null) {
            path = cms.addSiteRoot(cms.getRequestContext().getFolderUri());
        }

        return path;
    }
1035582
def set_umask(mask):
    '''
    
    '''
    if mask is None or salt.utils.platform.is_windows():
        # Don't attempt on Windows, or if no mask was passed
        yield
    else:
        try:
            orig_mask = os.umask(mask)  # pylint: disable=blacklisted-function
            yield
        finally:
            os.umask(orig_mask)
754090
protected File getTmpFolder() {
    final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList();
    final File _result;
    synchronized (_createCache_getTmpFolder) {
      if (_createCache_getTmpFolder.containsKey(_cacheKey)) {
        return _createCache_getTmpFolder.get(_cacheKey);
      }
      File _createTempDir = Files.createTempDir();
      _result = _createTempDir;
      _createCache_getTmpFolder.put(_cacheKey, _result);
    }
    _init_getTmpFolder(_result);
    return _result;
  }
848564
public static Mode applyDirectoryUMask(Mode mode, String authUmask) {
    return applyUMask(mode, getUMask(authUmask));
  }
1204775
public static File findTemplateDirectory( ApplicationTemplate tpl, File configurationDirectory ) {

		StringBuilder sb = new StringBuilder( TEMPLATES );
		sb.append( "/" );
		sb.append( tpl.getName());
		if( ! Utils.isEmptyOrWhitespaces( tpl.getVersion())) {
			sb.append( " - " );
			sb.append( tpl.getVersion());
		}

		return new File( configurationDirectory, sb.toString());
	}
1256437
def getdilatedmask(self, size=3):
        
        if size == 3:
            dilmask = ndimage.morphology.binary_dilation(self.mask, structure=growkernel, iterations=1, mask=None, output=None, border_value=0, origin=0, brute_force=False)
        elif size == 5:
            dilmask = ndimage.morphology.binary_dilation(self.mask, structure=dilstruct, iterations=1, mask=None, output=None, border_value=0, origin=0, brute_force=False)
        else:
            dismask = self.mask.copy()
        
        return dilmask
909942
public CmsOrganizationalUnit createWebOU(String ouFqn, String description, boolean hideLogin) {

        try {
            return OpenCms.getOrgUnitManager().createOrganizationalUnit(
                m_cms,
                ouFqn,
                description,
                (hideLogin ? CmsOrganizationalUnit.FLAG_HIDE_LOGIN : 0) | CmsOrganizationalUnit.FLAG_WEBUSERS,
                null);
        } catch (CmsException e) {
            // TODO Auto-generated catch block
            m_shell.getOut().println(
                getMessages().key(Messages.GUI_SHELL_WEB_OU_CREATION_FAILED_2, ouFqn, description));
            return null;
        }
    }
1349505
public alluxio.grpc.PModeOrBuilder getModeOrBuilder() {
    return mode_ == null ? alluxio.grpc.PMode.getDefaultInstance() : mode_;
  }
1133194
function concatPubPath(env, fileName) {

        "use strict";

        var hostPrefixMap = {
            'daily': 'h5.waptest',
            'prepub': 'h5.wapa',
            'wapp': 'wapp.m', //未定义
            'online': 'h5.m'
        };

        return 'http://' + [hostPrefixMap[env] + '.tao'+''+'bao.com', awpConfig.oWebappDir, fileName].join('/');

    }
832910
static File getAppFolder(final File baseDirectory, final String configuration, final String sdk)
  {
    return new File(getBuildDir(baseDirectory), configuration + "-" + sdk);
  }
275122
public File getDirectory(String sPath) {
        File  directory = new File(sPath);
        if (!directory.isDirectory()) {
            URL resource = FilterFileManager.class.getClassLoader().getResource(sPath);
            try {
                directory = new File(resource.toURI());
            } catch (Exception e) {
                LOG.error("Error accessing directory in classloader. path=" + sPath, e);
            }
            if (!directory.isDirectory()) {
                throw new RuntimeException(directory.getAbsolutePath() + " is not a valid directory");
            }
        }
        return directory;
    }
898828
private UnderFileSystem getOrAdd(AlluxioURI ufsUri, UnderFileSystemConfiguration ufsConf) {
    Key key = new Key(ufsUri, ufsConf.getMountSpecificConf());
    UnderFileSystem cachedFs = mUnderFileSystemMap.get(key);
    if (cachedFs != null) {
      return cachedFs;
    }
    // On cache miss, synchronize the creation to ensure ufs is only created once
    synchronized (mLock) {
      cachedFs = mUnderFileSystemMap.get(key);
      if (cachedFs != null) {
        return cachedFs;
      }
      UnderFileSystem fs = UnderFileSystem.Factory.create(ufsUri.toString(), ufsConf);

      // Detect whether to use managed blocking on UFS operations.
      boolean useManagedBlocking = fs.isObjectStorage();
      if (ufsConf.isSet(PropertyKey.UNDERFS_RUN_WITH_MANAGEDBLOCKING)) {
        useManagedBlocking = ufsConf.getBoolean(PropertyKey.UNDERFS_RUN_WITH_MANAGEDBLOCKING);
      }
      // Wrap UFS under managed blocking forwarder if required.
      if (useManagedBlocking) {
        fs = new ManagedBlockingUfsForwarder(fs);
      }

      mUnderFileSystemMap.putIfAbsent(key, fs);
      mCloser.register(fs);
      try {
        connectUfs(fs);
      } catch (IOException e) {
        LOG.warn("Failed to perform initial connect to UFS {}: {}", ufsUri, e.getMessage());
      }
      return fs;
    }
  }
566140
public static IntegrationFlowBuilder enhanceFlowForReadingMode(IntegrationFlowBuilder flowBuilder,
			FileConsumerProperties fileConsumerProperties) {
		switch (fileConsumerProperties.getMode()) {
		case contents:
			flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE,
					"application/octet-stream"))
					.transform(Transformers.fileToByteArray());
			break;
		case lines:
			Boolean withMarkers = fileConsumerProperties.getWithMarkers();
			if (withMarkers == null) {
				withMarkers = false;
			}
			flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE,
					"text/plain"))
					.split(new FileSplitter(true, withMarkers, fileConsumerProperties.getMarkersJson()));
		case ref:
			break;
		default:
			throw new IllegalArgumentException(fileConsumerProperties.getMode().name() +
					" is not a supported file reading mode.");
		}
		return flowBuilder;
	}
1356240
private static Mask apiMask() {
    return new Mask()
      .addInclusion("org/sonar/api/")
      .addInclusion("org/sonar/check/")
      .addInclusion("org/codehaus/stax2/")
      .addInclusion("org/codehaus/staxmate/")
      .addInclusion("com/ctc/wstx/")
      .addInclusion("org/slf4j/")

      // SLF4J bridges. Do not let plugins re-initialize and configure their logging system
      .addInclusion("org/apache/commons/logging/")
      .addInclusion("org/apache/log4j/")
      .addInclusion("ch/qos/logback/")

      // Exposed by org.sonar.api.server.authentication.IdentityProvider
      .addInclusion("javax/servlet/")

      // required for some internal SonarSource plugins (billing, orchestrator, ...)
      .addInclusion("org/sonar/server/platform/")

      // required for commercial plugins at SonarSource
      .addInclusion("com/sonarsource/plugins/license/api/")

      // API exclusions
      .addExclusion("org/sonar/api/internal/");
  }
685459
public static File getOrCreateFile(String url, boolean createIfNotFound) throws IOException {
        File file = null;
        if (url.contains(ResourceUtils.CLASSPATH_URL_PREFIX)) {
            url = url.replaceAll(ResourceUtils.CLASSPATH_URL_PREFIX, "");
            if (url.startsWith("/")) {
                url = url.substring(1);
            }
            URL resource = SenBotContext.class.getClassLoader().getResource("");
            if (resource == null) {
                throw new IOException("creating a new folder on the classpath is not allowed");
            } else {
                file = new File(resource.getFile() + "/" + url);
            }
        } else {
            file = new File(url);
        }
        if (createIfNotFound && !file.exists()) {
            file.mkdirs();
        }
        return file;
    }