Determine whether a given file is one of the files created by setup_container_system_config().
    @param file: Absolute file path as string.
544321
def is_container_system_config_file(file):
    
    if not file.startswith("/etc/"):
        return False
    return file in [os.path.join("/etc", f.decode()) for f in CONTAINER_ETC_FILE_OVERRIDE]
187875
function isExecutable(string $file): bool {
    $fileInfo = new \SplFileInfo($file);
    if (!$fileInfo->isFile()) return false;
    if ($fileInfo->isExecutable()) return true;
    return static::isWindows() ? $this->checkFileExtension($fileInfo) : $this->checkFilePermissions($fileInfo);
  }
751758
public static boolean isSnapshotFile(File file) {
    checkNotNull(file, "file cannot be null");
    String fileName = file.getName();

    // The file name should contain an extension separator.
    if (fileName.lastIndexOf(EXTENSION_SEPARATOR) == -1) {
      return false;
    }

    // The file name should end with the snapshot extension.
    if (!fileName.endsWith("." + EXTENSION)) {
      return false;
    }

    // Parse the file name parts.
    String[] parts = fileName.substring(0, fileName.lastIndexOf(EXTENSION_SEPARATOR)).split(String.valueOf(PART_SEPARATOR));

    // The total number of file name parts should be at least 2.
    if (parts.length < 2) {
      return false;
    }

    // The second part of the file name should be numeric.
    // Subtract from the number of parts to ensure PART_SEPARATOR can be used in snapshot names.
    if (!isNumeric(parts[parts.length - 1])) {
      return false;
    }

    // Otherwise, assume this is a snapshot file.
    return true;
  }
723137
private void checkForConfigPath(File configFile) {
        String desktopLayoutFilePath = configFile.getAbsolutePath();
        String configDirPath = desktopLayoutFilePath.substring(0, desktopLayoutFilePath.lastIndexOf(System
                .getProperty("file.separator")));
        File configDir = new File(configDirPath);

        // create config dir if it does not exist
        if (!configDir.exists()) {
            boolean success = configDir.mkdirs();
            if(success)
                logger.debug("Newly created config directory");
            else
                logger.warn("Could not create config directory");
        }
    }
261060
protected boolean isSourceFile(File file) {
        String name = file.getName();
        String extension = Files.getExtension(name).toLowerCase();
        return sourceFileExtensions.contains(extension) || sourceFileNames.contains(name);
    }
911626
public static Exception checkFile(final File file)
	{
		Exception ex = null;
		String error = null;
		// check if the file does not exists...
		if (!file.exists())
		{
			error = "The " + file + " does not exists.";
			ex = new FileDoesNotExistException(error);
			return ex;
		}
		// check if the file is not a directory...
		if (!file.isDirectory())
		{
			error = "The " + file + " is not a directory.";
			ex = new FileIsNotADirectoryException(error);
			return ex;
		}

		final File[] ff = file.listFiles();
		// If the file is null
		if (ff == null)
		{ // it is security restricted
			error = "The " + file + " could not list the content.";
			ex = new DirectoryHasNoContentException(error);
		}
		return ex;
	}
853134
final public function hasFile($file)
	{
		$helloReflection = new \ReflectionClass($this);
		$dir = dirname($helloReflection->getFilename());

		if(file_exists($dir . '/' . $file)) {
			return $dir . '/' . $file;
		}
		return false;
	}
1367132
private function isAllowedFileType($file) {
	$path_parts = pathinfo($file);
	// if there is no extension AND no extension file are not allowed
	if(!isset($path_parts['extension']) && $this->config['security']['allowNoExtension'] == false) {
		return false;
	} else {
		return true;
	}
	$exts = array_map('strtolower', $this->config['security']['uploadRestrictions']);
	if($this->config['security']['uploadPolicy'] == 'DISALLOW_ALL') {
		if(!in_array(strtolower($path_parts['extension']), $exts))
			return false;
	}
	if($this->config['security']['uploadPolicy'] == 'ALLOW_ALL') {
		if(in_array(strtolower($path_parts['extension']), $exts))
			return false;
	}
	return true;
}
494430
public boolean fileMatchesRules(File file) {

        try {
            if(file.exists()) {
                if(includeFilesContainingText.length == 0 && excludeFilesContainingText.length == 0) {
                    return fileMatchesRules(
							getComparableFileName(file));
                } else {
                    return fileMatchesRules(
							getComparableFileName(file),
                            FileSupport.getTextFileFromFS(file));
                }
            }
        } catch (IOException ioe) {
            //at the moment file does not match rules
        }
		return false;
	}
1360605
public boolean accepts(VirtualFile file) {
        String name = file.getName();
        boolean accepts = false;
        for (String suffix : suffixes) {
            if (name.endsWith(suffix)) {
                accepts = true;
                break;
            }
        }
            VFSLogger.ROOT_LOGGER.tracef("%s accepted: %s", file, accepts);
        return accepts;
    }
1375051
public static boolean isInDirectory(File file, File directory) {
        try {
            return FilenameUtils.directoryContains(directory.getCanonicalPath(), file.getCanonicalPath());
        } catch (IOException e) { //NOSONAR
            return false;
        }
    }
1011953
private boolean isProcessConfigFile(File file) {
		if (this.configuration.getProcessConfigDirOrFile().isFile()) {
			return file.equals(this.configuration.getProcessConfigDirOrFile());
		}

		// If the file doesn't exist anymore, treat it as a regular file (to handle file deletion events)
		if(file.exists() && !file.isFile()) {
			return false;
		}

		final String fileName = file.getName();
		return !fileName.startsWith(".") && (fileName.endsWith(".json") || fileName.endsWith(".yml") || fileName.endsWith(".yaml"));
	}
1248019
@Override
    public void onFileCreate(File file) {
        try {
            engine.addTemplate(context.getBundle(0), file.toURI().toURL());
        } catch (MalformedURLException e) {
            LOGGER.error("Cannot compute the url of file {}", file.getAbsolutePath(), e);
        }
    }
1348112
private boolean isValidFile(String s, Set<JavaFileObject.Kind> fileKinds) {
        JavaFileObject.Kind kind = getKind(s);
        return fileKinds.contains(kind);
    }
779666
public void setFile(File file) throws FileNotFoundException{
		this.setInputStream(new BufferedInputStream(new FileInputStream(file)), file.length());
		this.isUploadFile = true;
	}
1123030
def excluded?(file)
      file = File.join(Dir.pwd, file) unless file.start_with?('/')
      Codeqa.configuration.excludes.any?{ |pattern| match_path?(pattern, file) }
    end
24179
@Override
    public void setFile(File file) {
        configFile = file;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "Jaspi configuration of persistent providers will be stored in file: " + file);
    }