本文整理汇总了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));
}