Check resource access allowed
@param workspaceName
@param path
@return true if access is allowed otherwise false
504301
private boolean isAllowedPath(String workspaceName, String path)
   {
      if(pattern == null)
         return true;
      Matcher matcher= pattern.matcher(workspaceName+":"+path);
      if(!matcher.find())
      {
         log.warn("Access not allowed to webdav resource {}",path);
         return false;
      }
      return true;
   }
1303245
public boolean checkAccess(String path, boolean readOnly) {
        final FileServiceMXBean fileService = getFileService();
        if (readOnly) {
            //we can read from both the read and write list
            return (FileServiceUtil.isPathContained(fileService.getReadList(), path) || FileServiceUtil.isPathContained(fileService.getWriteList(), path));
        } else {
            //we can write only to the write list
            return FileServiceUtil.isPathContained(fileService.getWriteList(), path);
        }
    }
1231954
def is_resource_protected(self, request, **kwargs):
        
        exempt_urls = self.get_exempt_url_patterns()
        protected_urls = self.get_protected_url_patterns()
        path = request.path_info.lstrip('/')

        path_is_exempt = any(m.match(path) for m in exempt_urls)
        if path_is_exempt:
            return False

        path_is_protected = any(m.match(path) for m in protected_urls)
        if path_is_protected:
            return True

        return False
549639
private static boolean couldBeYarnConfigurationPath(final String path) {
    return path.contains("conf") ||
            path.contains("etc") ||
            path.contains(HadoopEnvironment.HADOOP_CONF_DIR);
  }
1069455
private void check( String pathName )
    {
        for ( char c : pathName.toCharArray() ) {
            if ( c < 32 || FORBIDDEN_CHAR == c ) {
                throw new IllegalArgumentException( "Pathname contains invalid char " + c + " : " + pathName );
            }
        }
        // Check each component :
        for ( String comp : pathName.split( "/" ) ) {
            if ( !comp.trim().equals( comp ) ) {
                throw new IllegalArgumentException( "Pathname contains leading or trailing spaces : " + pathName );
            }
        }
    }
190673
public boolean blocksPathForUA(String path, String ua) {

		if(rules.containsKey(ua.toLowerCase())) {

			return blocksPath(path,ua,rules.get(ua.toLowerCase()));

		} else if(rules.containsKey(GLOBAL_USER_AGENT)) {

			return blocksPath(path,GLOBAL_USER_AGENT,
					rules.get(GLOBAL_USER_AGENT));			
		}
		return false;
	}
1156201
public boolean isHubPath(String path) throws IOException {
        if ("/".equals(path))
            return true;
        for (String root : getNonHubRoots()) {
            if (root.startsWith("*")) {
                if (path.endsWith(root.substring(1)))
                    return false;
            }
            else if (path.equals(root) || path.startsWith(root + "/")) {
                return false;
            }
        }
        return true;
    }
1361767
boolean isSpecialPath(String path) {
        if (rootZookeeper.equals(path) || procZookeeper.equals(path)
                || quotaZookeeper.equals(path)) {
            return true;
        }
        return false;
    }
647625
@Override
    public URL getResource(final String path) {
        final ResourceList resourceList = scanResult.getResourcesWithPath(path);
        if (resourceList == null || resourceList.isEmpty()) {
            return super.getResource(path);
        } else {
            return resourceList.get(0).getURL();
        }
    }
618041
public boolean isAssetFile(File path) {
        boolean isAsset = false;

        try {
            if(FileUtil.directoryOnlyIfNotIgnored(path.getParentFile())) {
                if (FileUtil.isFileInDirectory(path, config.getAssetFolder())) {
                    isAsset = true;
                } else if (FileUtil.isFileInDirectory(path, config.getContentFolder())
                    && FileUtil.getNotContentFileFilter().accept(path)) {
                    isAsset = true;
                }
            }
        } catch (IOException ioe) {
            LOGGER.error("Unable to determine the path to asset file {}", path.getPath(), ioe);
        }
        return isAsset;
    }
154880
public @CheckForNull FilePath getWorkspaceRoot() {
        FilePath r = getRootPath();
        if(r==null) return null;
        return r.child(WORKSPACE_ROOT);
    }
339126
@Override
	public void checkPermission(String resourceName, String action) throws JMSException 
	{
		for (int i = 0; i < privileges.size(); i++)
		{
			Privilege privilege = privileges.get(i);
			if (privilege.matches(resourceName, action))
				return;
		}
		throw new FFMQException("Access denied to resource '"+resourceName+"' for action '"+action+"'","ACCESS_DENIED");
	}
1355232
private function isPathAccessible($path)
    {
        $uri = $this->httpUtils->generateUri($this->requestStack->getMasterRequest(), $path);

        /** @var \Buzz\Message\Response $res */
        $res = $this->browser->get($uri);
        if ($res->isSuccessful()) {
            return true;
        }

        return false;
    }
648875
protected boolean isAccessPermitted(String resourceName) {

		boolean accessible = true;
		if (resourceName.startsWith(JawrConstant.WEB_INF_DIR_PREFIX)) {
			if (resourceName.startsWith(JawrConstant.WEB_INF_DIR_PREFIX + GRAILS_APP_DIR)
					&& resourceName.endsWith(GrailsLocaleUtils.MSG_RESOURCE_BUNDLE_SUFFIX)) {
				accessible = true;
			} else {
				accessible = false;
			}
		}

		return accessible;
	}
769404
function isPathAccessible (filePath) {
  try {
    fs.accessSync(filePath)
    debug(`Utils: isPathAccessible(): ${filePath} exists`)
    return true
  } catch (err) {
    debug(`Utils: isPathAccessible(): ${filePath} does not exist`)
    return false
  }
}
391296
private boolean isInZkWathcedNamespacePaths(String path) {
        if (StringUtil.isEmpty(path)) {
            return false;
        }
        for (String watchNamespacePath : RpcClientConf.ZK_WATCH_NAMESPACE_PATHS) {
            if (StringUtil.isEmpty(watchNamespacePath)) {
                continue;
            }
            if (path.contains(watchNamespacePath)) {
                return true;
            }
        }
        return false;
    }
74286
private boolean isValidOpenPath(CmsObject cms, String openPath) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(openPath)) {
            return false;
        }
        if (!cms.existsResource(openPath)) {
            // in case of a detail-page check the parent folder
            String parent = CmsResource.getParentFolder(openPath);
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(parent) || !cms.existsResource(parent)) {
                return false;
            }
        }
        return true;
    }