Checks whether a folder and its content is valid for packaging into the .apk as
standard Java resource.
@param folderName the name of the folder.
967968
public static boolean checkFolderForPackaging(String folderName) {
        return !folderName.equalsIgnoreCase("CVS") &&
                !folderName.equalsIgnoreCase(".svn") &&
                !folderName.equalsIgnoreCase("SCCS") &&
                !folderName.startsWith("_");
    }
1110000
private static boolean accept(final String extension, final File pathname) {
        if (nulls(extension, pathname)) return false;
        String absPath = pathname.getAbsolutePath();
        final int extLength = extension.length();
        int start = absPath.length() - extLength, end = absPath.length();
        String ext = absPath.substring(start, end);
        if (extension.equalsIgnoreCase(ext)) return true;
        return false;
    }
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 );
            }
        }
    }
1161889
private static void checkResource(final List<String> resources, final Pattern searchPattern, final String resourceName) {
        if (searchPattern.matcher(resourceName).matches()) {
            resources.add(resourceName);
        }
    }
329101
public void mkdir(String folderName) {
    try {
      getDFS().mkdirs(new Path(this.path, folderName));
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
    doRefresh();
  }
609927
private boolean validateServiceIntent(Context context, Intent intent) {
        ResolveInfo resolveInfo = context.getPackageManager().resolveService(intent, 0);
        if (resolveInfo == null) {
            return false;
        }

        return validateAppSignatureForPackage(context, resolveInfo.serviceInfo.packageName);
    }
353259
function verifyAppFolder(folderPath) {
  const resolvedFolderPath = path.join(path.resolve(tmp), 'src', 'app', folderPath);
  return new Promise((resolve, reject) => {
    if (!fs.existsSync(resolvedFolderPath)) {
      fs.mkdirSync(resolvedFolderPath);
    }

    resolve();
  });
}
1048691
public boolean validatePackageNameType(String packageNameType, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return true;
	}
535525
public boolean match(String vfsName) {

        boolean match = false;

        for (int j = 0; j < m_vfsFolders.size(); j++) {
            Pattern pattern = m_vfsFolders.get(j);
            match = pattern.matcher(vfsName).matches();
            if (match) {
                break;
            }
        }
        return match;
    }
503781
private boolean isValidEntryAndPath(CmsClientSitemapEntry entry, String toPath) {

        return ((toPath != null)
            && (CmsResource.getParentFolder(toPath) != null)
            && (entry != null)
            && (getEntry(CmsResource.getParentFolder(toPath)) != null)
            && (getEntry(entry.getSitePath()) != null));
    }
117917
private boolean folderContainsFiles(File folder) {
        if (folder != null) {
            File[] files = folder.listFiles();
            for (File file : files)
                if (file.isFile())
                    return true;
            for (File file : files)
                if (file.isDirectory())
                    if (folderContainsFiles(file))
                        return true;
        }
        return false;
    }
770935
@Override
  public boolean visit(final PackageNode node) {
    if (!node.getName().isEmpty()) {
      this.graphStr
          .append("  ")
          .append(node.getName())
          .append(" [label=\"")
          .append(node.getFullName())
          .append("\", shape=folder];\n");
    }
    return true;
  }
709000
protected function isFileMarked(string $packageName, string $file): bool
    {
        return \is_file($file) && \strpos(\file_get_contents($file), \sprintf('/** > %s **/', $packageName)) !== false;
    }
1361034
public static void touch(final File folder , final String fileName) throws IOException {
        if(!folder.exists()){
            folder.mkdirs();
        }

        final File touchedFile = new File(folder, fileName);

        // The JVM will only 'touch' the file if you instantiate a
        // FileOutputStream instance for the file in question.
        // You don't actually write any data to the file through
        // the FileOutputStream.  Just instantiate it and close it.

        try (
            FileOutputStream doneFOS = new FileOutputStream(touchedFile);
        ) {
            // Touching the file
        }
        catch (FileNotFoundException e) {
            throw new FileNotFoundException("Failed to the find file." + e);
        }
    }
1161963
public static void checkValidDir(final File dir) {
        checkNotNull("dir", dir);
        if (!dir.exists()) {
            throw new IllegalArgumentException("The directory '" + dir + "' does not exist!");
        }
        if (!dir.isDirectory()) {
            throw new IllegalArgumentException("The name '" + dir + "' is not a directory!");
        }
    }
1000797
public static void checkFolderForFile(String fileName) throws IOException {

		if (fileName.lastIndexOf(File.separator) > 0) {
			String folder = fileName.substring(0, fileName.lastIndexOf(File.separator));
			directoryCheck(folder);
		}
	}
1356969
function (packageName, context) {
        context = context || '';
        if (!packageName) {
            Aria.$logError(Aria.INVALID_PACKAGENAME_FORMAT, [packageName, context]);
            return false;
        }
        if (Aria.isJsReservedWord(packageName)) {
            Aria.$logError(Aria.INVALID_PACKAGENAME_RESERVED, [packageName, context]);
            return false;
        }
        if (!packageName.match(/^[a-z]\w*$/)) {
            Aria.$logInfo(Aria.INVALID_PACKAGENAME_FORMAT, [packageName, context]);
        }
        return true;
    }