本文整理匯總了Java中org.apache.commons.io.IOCase.INSENSITIVE屬性的典型用法代碼示例。如果您正苦於以下問題:Java IOCase.INSENSITIVE屬性的具體用法?Java IOCase.INSENSITIVE怎麽用?Java IOCase.INSENSITIVE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.commons.io.IOCase
的用法示例。
在下文中一共展示了IOCase.INSENSITIVE屬性的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getModels
/**
* Gets the models.
*
* @return the models
*/
public static String[] getModels() {
File dir = new File(Config.getConfiguration().getString(MODELPATH));
LOG.info("Loading Models from... " + dir.getAbsolutePath());
List<String> models = new ArrayList<>();
String[] modelNames = getModelNames();
List<String> wildCardPath = Arrays.stream(modelNames).map(model -> {
return "en-ner-" + model + "*.bin";
}).collect(Collectors.toList());
FileFilter fileFilter = new WildcardFileFilter(wildCardPath,
IOCase.INSENSITIVE);
List<String> filePath = Arrays.asList(dir.listFiles(fileFilter))
.stream().map(file -> file.getAbsolutePath())
.collect(Collectors.toList());
return filePath.toArray(new String[filePath.size()]);
}
示例2: findFilesToAnalyze
public static List<String> findFilesToAnalyze(String dirPath) {
IOFileFilter gitFilter = FileFilterUtils.notFileFilter(
FileFilterUtils.nameFileFilter(".git")
);
File dir = new File(dirPath);
String[] phpExt = new String[] {"php"};
IOFileFilter phpFilter = new SuffixFileFilter(phpExt, IOCase.INSENSITIVE);
List<File> files = (List<File>) FileUtils.listFiles(dir, phpFilter, gitFilter);
List<String> results = new ArrayList<String>();
for (File f : files) {
try {
results.add(f.getCanonicalPath());
} catch (IOException e) {
e.printStackTrace();
}
}
return results;
}
示例3: VFSManager
public VFSManager(File systemDir, File userDir) {
super(systemDir, userDir, new SuffixFileFilter(".xml", IOCase.INSENSITIVE));
Comparator<File> nameComparator = new Comparator<File>() {
@Override
public int compare(File f1, File f2) {
// we want vfs.xml to loaded first, always.
if (f1.getName().equals("x-vfs.xml"))
return Integer.MIN_VALUE;
if (f2.getName().equals("x-vfs.xml"))
return Integer.MAX_VALUE;
return f1.getName().compareToIgnoreCase(f2.getName());
}
};
getSystemFiles().setNameComparator(nameComparator);
}
示例4: searchPrefixFile
/**
* 查找需要合並文件的臨時文件信息
*
* @param directory 臨時文件所在的目錄
* @param prefix 臨時文件的前綴
* @param caseSensitivity 臨時文件的大小寫敏感
* @return collection
*/
public static Collection<File> searchPrefixFile(File directory, String prefix, boolean
caseSensitivity) {
IOCase iocase = IOCase.INSENSITIVE;
if (caseSensitivity) {
iocase = IOCase.SENSITIVE;
}
//創建相關的過濾器
IOFileFilter fileFilter = FileFilterUtils.prefixFileFilter(prefix, iocase);
//檢查相關的過濾信息
return FileUtils.listFiles(directory, fileFilter, FalseFileFilter.INSTANCE);
}
示例5: getModsFileFilter
/**
* Creates a filter that returns everything in the "mods" folder except
* the specified cubes which are distributed with each new release and
* any existing themes which are now found in the "themes" folder.
*/
private FileFilter getModsFileFilter() {
final String[] excludedCubes = new String[]{
"legacy_cube.txt", "modern_cube.txt", "standard_cube.txt", "extended_cube.txt", "ubeefx_cube.txt"
};
final IOFileFilter cubesFilter = new NameFileFilter(excludedCubes, IOCase.INSENSITIVE);
final IOFileFilter excludeCubes = FileFilterUtils.notFileFilter(cubesFilter);
final IOFileFilter excludeThemes = FileFilterUtils.notFileFilter(new WildcardFileFilter("*_theme*"));
return FileFilterUtils.and(excludeCubes, excludeThemes);
}
示例6: MetadataManager
public MetadataManager(File systemDir, File userDir) {
super(systemDir, userDir, new SuffixFileFilter(".xml", IOCase.INSENSITIVE));
this.dtd = new File(systemDir, "metadata.dtd");
dtdResolver = new EntityResolver() {
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
return new InputSource(new FileInputStream(dtd));
}
};
}
示例7: scanDirectory
private Collection<File> scanDirectory(final File directory) {
if (!directory.isDirectory()) {
return Collections.emptyList();
}
RegexFileFilter regexFileFilter = new RegexFileFilter(PROPERTIES_FILE_PATTERN, IOCase.INSENSITIVE);
return FileUtils.listFiles(directory, regexFileFilter, FileFilterUtils.trueFileFilter());
}
開發者ID:openwide-java,項目名稱:localization-properties-consistency-maven-plugin,代碼行數:8,代碼來源:LocalizationPropertiesConsistencyMojo.java
示例8: getFileNameBasedFilter
protected IOFileFilter getFileNameBasedFilter(String fileNamePattern) {
if (StringUtils.isNotBlank(fileNamePattern)) {
return new WildcardFileFilter(fileNamePattern, IOCase.INSENSITIVE);
}
return null;
}
示例9: OnlineVideosUrlResolverManager
public OnlineVideosUrlResolverManager(File systemDir, File userDir) {
super(systemDir, userDir, new WildcardFileFilter(new String[]{"*.java", "*.groovy", "*.py"}, IOCase.INSENSITIVE));
}
示例10: FileMatcherManager
public FileMatcherManager(File systemDir, File userDir) {
super(systemDir, userDir, new SuffixFileFilter("MediaTitles.xml", IOCase.INSENSITIVE));
}
示例11: RatingsManager
public RatingsManager(File systemDir, File userDir) throws IOException {
super(systemDir, userDir, new SuffixFileFilter("ratings.properties", IOCase.INSENSITIVE));
}
示例12: ConfigurationMetadataManager
public ConfigurationMetadataManager(File systemDir, File userDir) {
super(systemDir, userDir, new SuffixFileFilter(".xml", IOCase.INSENSITIVE));
}
示例13: MenuManager
public MenuManager(File systemDir, File userDir) {
super(systemDir, userDir, new SuffixFileFilter(".xml", IOCase.INSENSITIVE));
}