Determines if a file is dirty
@private
@param {!File} file - file to test
@return {boolean} true if the file is dirty, false otherwise
924
function _isOpenAndDirty(file) {
        // working set item might never have been opened; if so, then it's definitely not dirty
        var docIfOpen = DocumentManager.getOpenDocumentForPath(file.fullPath);
        return (docIfOpen && docIfOpen.isDirty);
    }
1170578
function isJsonFile (file) {
  return file.data &&                             // The file has data
    (typeof file.data === 'string') &&            // and it's a string
    (
      mimeTypePattern.test(file.mimeType) ||      // and it has a JSON MIME type
      extensionPattern.test(file.url)             // or at least a .json file extension
    );
}
702647
function check(file, frontmatter) {
      // Only process files that match the pattern
      if (!match(file, pattern)[0]) {
        return false;
      }

      // Don't process private files
      if (get(frontmatter, privateProperty)) {
        return false;
      }

      return true;
    }
711685
private static void clean(String file) throws IOException {
		
		StringBuffer sb = new StringBuffer();
		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file),Charset.forName("utf8")));
		String str;
		while((str = br.readLine())!=null){
			if(str.length()!=0&&!str.trim().startsWith("<")){
				if(str.equalsIgnoreCase("root"))
					continue;
				if(str.contains("</HEADER> ")||str.contains("</HEADLINE>"))
					continue;
				sb.append(str+"\n");

			}				
		}

		br.close();
		Writer wr = new OutputStreamWriter(new FileOutputStream(new File(file)),Charset.forName("gbk"));//输出目录
		wr.write(sb.toString());
		wr.close();

	}
851261
private static void checkFile(File file) {
		if (false == file.exists()) {
			throw new UtilException("File [{}] not exist !", file.getAbsolutePath());
		}
		if (false == file.isFile()) {
			throw new UtilException("Path [{}] is not a file !", file.getAbsolutePath());
		}
	}
269250
public static void checkValidFile(final File file) {
        checkNotNull("file", file);
        if (!file.exists()) {
            throw new IllegalArgumentException("The file '" + file + "' does not exist!");
        }
        if (!file.isFile()) {
            throw new IllegalArgumentException("The name '" + file + "' is not a file!");
        }
    }
1065557
async function isFileOfType(filename, condition){
    try{
        // get stats
        const stats = await _fs.stat(filename);

        // is directory ?
        return condition(stats);
    }catch(e){
        // file not found error ?
        if (e.code === 'ENOENT'){
            return false;
        }else{
            throw e;
        }
    }
}
633278
function shouldSkip(file, rough) {
  // Basically, if rough, any small change should still process the content
  return rough
    ? file.cache.status === LocalStatus.Unchanged
    : file.content.status === LocalStatus.Unchanged;
}
526444
function(file) {
        var type =  '|' + file.type.slice(file.type.lastIndexOf('/') + 1) + '|';
        return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1;
      }
798094
public static boolean delFileOrFolder(File file) {
        if (file == null || !file.exists()) {
            // do nothing
        } else if (file.isFile()) {
            file.delete();
        } else if (file.isDirectory()) {
            File[] files = file.listFiles();
            if (files != null) {
                for (File sonFile : files) {
                    delFileOrFolder(sonFile);
                }
            }
            file.delete();
        }
        return true;
    }
457563
function File(file) {
  this.cache = new Map();
  this.history = [];
  this.pattern = file.pattern;
  this.recurse = file.recurse;
  this.dirname = file.dirname;
  this.segment = file.segment;
  this.path = file.path;
  this.orig = file.path;
}
39486
function hasFileType(file, fileExt) {
  file = path.basename(file);
  var ext = path.extname(file);
  do {
    if (ext === fileExt) {
      return true;
    } else {
      file = path.basename(file, ext);
      ext = path.extname(file);
    }
  } while (ext);
  return false;
}
403697
def is_dirty(self, index=True, working_tree=True, untracked_files=False,
                 submodules=True, path=None):
        
        if self._bare:
            # Bare repositories with no associated working directory are
            # always consired to be clean.
            return False

        # start from the one which is fastest to evaluate
        default_args = ['--abbrev=40', '--full-index', '--raw']
        if not submodules:
            default_args.append('--ignore-submodules')
        if path:
            default_args.append(path)
        if index:
            # diff index against HEAD
            if osp.isfile(self.index.path) and \
                    len(self.git.diff('--cached', *default_args)):
                return True
        # END index handling
        if working_tree:
            # diff index against working tree
            if len(self.git.diff(*default_args)):
                return True
        # END working tree handling
        if untracked_files:
            if len(self._get_untracked_files(path, ignore_submodules=not submodules)):
                return True
        # END untracked files
        return False
705989
public boolean filterFile(File file)
    {
        String strName = file.getName();
        if (!strName.endsWith(".java"))
            return false;
        return super.filterFile(file);
    }
39903
function isFileBeingEdited(filePath) {
        var currentEditor   = EditorManager.getActiveEditor(),
            currentDoc      = currentEditor && currentEditor.document;

        return (currentDoc && currentDoc.file.fullPath === filePath);
    }
543095
public boolean filterFile(File file)
    {
        boolean bProcessFile = super.filterFile(file);
        if (bProcessFile == false)
            return bProcessFile;
        if ((this.getProperty(ConvertCode.DEST_DIR) != null) && (!this.getProperty(ConvertCode.DEST_DIR).equalsIgnoreCase(this.getProperty(ConvertCode.SOURCE_DIR))))
            return bProcessFile;
        String s = this.getNewCalendarPath(file);
        return (s != null);   // Skip if no new path (Only if moving to the same directory)
    }
710145
function(file) {
			var id = typeof(file) === 'string' ? file : file.id;

			for (var i = files.length - 1; i >= 0; i--) {
				if (files[i].id === id) {
					return this.splice(i, 1)[0];
				}
			}
		}