本文整理汇总了Java中org.apache.commons.io.filefilter.HiddenFileFilter.VISIBLE属性的典型用法代码示例。如果您正苦于以下问题:Java HiddenFileFilter.VISIBLE属性的具体用法?Java HiddenFileFilter.VISIBLE怎么用?Java HiddenFileFilter.VISIBLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.io.filefilter.HiddenFileFilter
的用法示例。
在下文中一共展示了HiddenFileFilter.VISIBLE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
@Override
protected void setUp() throws Exception {
testDir = new File(new File(".") , testDirName);
if (testDir.exists()) {
org.apache.commons.io.FileUtils.cleanDirectory(testDir);
} else {
testDir.mkdir();
}
IOFileFilter files = org.apache.commons.io.filefilter.FileFilterUtils.fileFileFilter();
IOFileFilter javaSuffix = org.apache.commons.io.filefilter.FileFilterUtils.suffixFileFilter(".java");
IOFileFilter fileFilter = org.apache.commons.io.filefilter.FileFilterUtils.and(files, javaSuffix);
IOFileFilter directories = org.apache.commons.io.filefilter.FileFilterUtils.directoryFileFilter();
IOFileFilter visible = HiddenFileFilter.VISIBLE;
IOFileFilter dirFilter = org.apache.commons.io.filefilter.FileFilterUtils.and(directories, visible);
IOFileFilter filter = org.apache.commons.io.filefilter.FileFilterUtils.or(dirFilter, fileFilter);
createObserver(testDir, filter);
}
示例2: loadPosts
/**
* 读取post信息
* <br><i>at 2014年7月12日下午4:36:36</i>
* @author lichee
* @see <a href="http://nicecoder.net">nicecoder.net</a>
*/
private void loadPosts(){
PostWalker pw = new PostWalker(
HiddenFileFilter.VISIBLE,
genFilter
);
try {
Collection<Post> rs = pw.loadPosts(new File(postsDir));
posts = new HashMap<String,Post>();
for(Post p : rs){
posts.put(p.getTitle(), p);
}
} catch (IOException e) {
e.printStackTrace();
}
}
示例3: getFiles
public List<InputFile> getFiles() {
List<InputFile> result = Lists.newArrayList();
if (getSourceDirs() == null) {
return result;
}
IOFileFilter suffixFilter = getFileSuffixFilter();
WildcardPattern[] exclusionPatterns = getExclusionPatterns(true);
IOFileFilter visibleFileFilter = HiddenFileFilter.VISIBLE;
for (File dir : getSourceDirs()) {
if (dir.exists()) {
// exclusion filter
IOFileFilter exclusionFilter = new ExclusionFilter(dir,exclusionPatterns);
// visible filter
List<IOFileFilter> fileFilters = Lists.newArrayList(visibleFileFilter, suffixFilter, exclusionFilter);
// inclusion filter
String inclusionPattern = (String) project.getProperty(SpringPlugin.INCLUDE_FILE_FILTER);
if (inclusionPattern != null) {
fileFilters.add(new InclusionFilter(dir, inclusionPattern));
}
fileFilters.addAll(this.filters);
// create DefaultInputFile for each file.
List<File> files = (List<File>) FileUtils.listFiles(dir, new AndFileFilter(fileFilters), HiddenFileFilter.VISIBLE);
for (File file : files) {
String relativePath = DefaultProjectFileSystem.getRelativePath(file, dir);
result.add(new DefaultInputFile(dir, relativePath));
}
}
}
return result;
}
示例4: LicensableFileDirectoryWalker
public LicensableFileDirectoryWalker( IOFileFilter fileFilter, String firstLine, String linePrefix, String lastLine ) {
super(HiddenFileFilter.VISIBLE,fileFilter,100);
this.firstLine = firstLine;
this.linePrefix = linePrefix;
this.lastLine = lastLine;
}