当前位置: 首页>>代码示例>>Java>>正文


Java HiddenFileFilter类代码示例

本文整理汇总了Java中org.apache.commons.io.filefilter.HiddenFileFilter的典型用法代码示例。如果您正苦于以下问题:Java HiddenFileFilter类的具体用法?Java HiddenFileFilter怎么用?Java HiddenFileFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HiddenFileFilter类属于org.apache.commons.io.filefilter包,在下文中一共展示了HiddenFileFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
@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);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:18,代码来源:AbstractMonitorTestCase.java

示例2: loadPosts

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
/**
 * 读取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();
	}
}
 
开发者ID:lichee,项目名称:JBrick,代码行数:23,代码来源:App.java

示例3: Get

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
/**
 * Builds a *VisibleFilesTraverser*.
 * @param startDirectory
 * @param ignoreFileNames
 * @return
 */
public static VisibleFilesTraverser Get(Path startDirectory, String...ignoreFileNames) {
    return new VisibleFilesTraverser(
            startDirectory,
            ignoreFileNames,
            FileFilterUtils.or(
                    // Show visible directories
                    FileFilterUtils.and(FileFilterUtils.directoryFileFilter(), HiddenFileFilter.VISIBLE),
                    // Show visible files
                    FileFilterUtils.and(FileFilterUtils.fileFileFilter(), HiddenFileFilter.VISIBLE)
            )
    );
}
 
开发者ID:AMOSTeam3,项目名称:amos-ss15-proj3,代码行数:19,代码来源:VisibleFilesTraverser.java

示例4: getFilesFromDirectory

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
public static List<File> getFilesFromDirectory(File directory) {
  IOFileFilter fileFilter = FileFilterUtils.makeSVNAware(HiddenFileFilter.VISIBLE);
  IOFileFilter dirFilter = FileFilterUtils.makeSVNAware(FileFilterUtils.and(
      FileFilterUtils.directoryFileFilter(),
      HiddenFileFilter.VISIBLE));
  return new ArrayList<File>(FileUtils.listFiles(directory, fileFilter, dirFilter));
}
 
开发者ID:ClearTK,项目名称:cleartk,代码行数:8,代码来源:DocumentClassificationEvaluation.java

示例5: extractPossibleDataFile

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
private static List<File> extractPossibleDataFile(File dwcFolder) {
  List<File> dataFiles = new ArrayList<>();
  for (String suffix : DATA_FILE_SUFFICES) {
    FileFilter ff = FileFilterUtils.and(
            FileFilterUtils.suffixFileFilter(suffix, IOCase.INSENSITIVE), HiddenFileFilter.VISIBLE
    );
    dataFiles.addAll(Arrays.asList(dwcFolder.listFiles(ff)));
  }
  return dataFiles;
}
 
开发者ID:gbif,项目名称:dwca-io,代码行数:11,代码来源:InternalDwcFileFactory.java

示例6: fromCompressed

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
static Archive fromCompressed(Path dwcaLocation, Path destination) throws IOException, UnsupportedArchiveException {
  if (!Files.exists(dwcaLocation)) {
    throw new FileNotFoundException("dwcaLocation does not exist: " + dwcaLocation.toAbsolutePath());
  }

  if (Files.exists(destination)) {
    // clean up any existing folder
    LOG.debug("Deleting existing archive folder [{}]", destination.toAbsolutePath());
    org.gbif.utils.file.FileUtils.deleteDirectoryRecursively(destination.toFile());
  }
  FileUtils.forceMkdir(destination.toFile());
  // try to decompress archive
  try {
    CompressionUtil.decompressFile(destination.toFile(), dwcaLocation.toFile(), true);
    // we keep subfolder, but often the entire archive is within one subfolder. Remove that root folder if present
    File[] rootFiles = destination.toFile().listFiles((FileFilter) HiddenFileFilter.VISIBLE);
    if (rootFiles.length == 1) {
      File root = rootFiles[0];
      if (root.isDirectory()) {
        // single root dir, flatten structure
        LOG.debug("Removing single root folder {} found in decompressed archive", root.getAbsoluteFile());
        for (File f : FileUtils.listFiles(root, TrueFileFilter.TRUE, null)) {
          File f2 = new File(destination.toFile(), f.getName());
          f.renameTo(f2);
        }
      }
    }
    // continue to read archive from the tmp dir
    return fromLocation(destination);
  } catch (CompressionUtil.UnsupportedCompressionType e) {
    throw new UnsupportedArchiveException(e);
  }
}
 
开发者ID:gbif,项目名称:dwca-io,代码行数:34,代码来源:InternalDwcFileFactory.java

示例7: loadVaults

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
public void loadVaults() throws IOException, JDOMException {

        GlacierVaultManager gvm;

        File gRootDir = getGlacierRootDir();
        log.debug("loadVaults(): getGlacierRootDir",getGlacierRootDir());

        File[] vaults = gRootDir.listFiles((FileFilter) HiddenFileFilter.VISIBLE);
        if (vaults != null) {
            log.debug("loadVaults(): Got {} vaults",vaults.length);

            for (File vault : vaults) {

                if(!vault.getName().equals(DefaultResourceCacheDirectoryName)){

                    String vaultName = vault.getName();
                    log.debug("loadVaults(): Loading vault: {} vaultName: {}",vault, vaultName);

                    if (vault.isDirectory()) {
                        gvm = new GlacierVaultManager(vaultName,gRootDir);
                        gvm.setParentContext(getGlacierServiceContext());
                        // gvm.loadArchiveRecords();
                        gvm.loadIndexObjects();
                        _vaults.put(gvm.name(),gvm);
                    }
                }

            }
        }


    }
 
开发者ID:OPENDAP,项目名称:olfs,代码行数:33,代码来源:GlacierManager.java

示例8: loadIndexObjects

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
public void loadIndexObjects() throws IOException, JDOMException {

        Index index;

        File indexDir = getIndexDir();
        File[] indexFiles = indexDir.listFiles((FileFilter) HiddenFileFilter.VISIBLE);

        if (indexFiles != null) {
            for (File indexFile : indexFiles) {
                if (indexFile.isFile()) {
                    index = new Index(indexFile);

                    StringBuilder resourceId = new StringBuilder();
                    String pathDelimiter = index.getDelimiter();

                    resourceId
                            //.append(getGlacierServiceContext())
                            .append(index.getPath())
                            .append(pathDelimiter)
                            .append(index.getIndexFileConvention());

                    index.setResourceId(resourceId.toString());
                    _indexObjects.put(index.getResourceId(),index);
                    _log.debug("Loaded Index. Vault: {} resourceId: {}", name(), index.getResourceId());

                }
                else {
                    _log.debug("Skipping directory/link {}", indexFile);
                }
            }
        } else {
            _log.debug("No index files found for vault {}", name());
        }

    }
 
开发者ID:OPENDAP,项目名称:olfs,代码行数:36,代码来源:GlacierVaultManager.java

示例9: close

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
@Override
public void close() throws IOException {
    // Delete all files that weren't written in this run.

    Collection<File> files = FileUtils.listFiles(target, HiddenFileFilter.VISIBLE, TrueFileFilter.INSTANCE);

    for (File file : files) {
        if (!this.files.contains(file)) {
            file.delete();

            deleteEmptyDirectory(file.getParentFile());
        }
    }
}
 
开发者ID:gmt-europe,项目名称:RollbaseUtils,代码行数:15,代码来源:FileWriter.java

示例10: getFolders

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
public List<String> getFolders()
    throws MojoExecutionException
{
    IOFileFilter folders = FileFilterUtils.and( HiddenFileFilter.VISIBLE, DirectoryFileFilter.DIRECTORY );
    IOFileFilter makeSVNAware = FileFilterUtils.makeSVNAware( folders );
    IOFileFilter makeCVSAware = FileFilterUtils.makeCVSAware( makeSVNAware );

    String[] list = folder.list( makeCVSAware );
    if ( list == null )
    {
        throw new MojoExecutionException( "The specified folder doesn't exist: " + folder );
    }

    List<File> listOfDirectories = new ArrayList<File>();
    for ( String item : list )
    {
        listOfDirectories.add( new File( folder, item ) );
    }

    Collections.sort( listOfDirectories, convertSortOrder() );
    List<String> resultList = new ArrayList<String>();
    for ( File file : listOfDirectories )
    {
        resultList.add( file.getName() );
    }
    return resultList;
}
 
开发者ID:khmarbaise,项目名称:iterator-maven-plugin,代码行数:28,代码来源:AbstractIteratorMojo.java

示例11: getFiles

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
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;
}
 
开发者ID:shmc,项目名称:sonar-spring-rules-plugin,代码行数:34,代码来源:SpringProjectFileSystem.java

示例12: getFilesFromDirectory

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
public static List<File> getFilesFromDirectory(File directory) {
  IOFileFilter fileFilter = FileFilterUtils.makeSVNAware(HiddenFileFilter.VISIBLE);
  IOFileFilter dirFilter = FileFilterUtils
      .makeSVNAware(FileFilterUtils.and(FileFilterUtils.directoryFileFilter(), HiddenFileFilter.VISIBLE));
  return new ArrayList<File>(FileUtils.listFiles(directory, fileFilter, dirFilter));
}
 
开发者ID:utk4rsh,项目名称:question-classifier,代码行数:7,代码来源:QuestionCategoryEvaluation.java

示例13: accept

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
@Override
public boolean accept(File file) {
  return FileFilterUtils.fileFileFilter().accept(file) && HiddenFileFilter.VISIBLE.accept(file);
}
 
开发者ID:ClearTK,项目名称:cleartk,代码行数:5,代码来源:UriCollectionReader.java

示例14: LicensableFileDirectoryWalker

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
public LicensableFileDirectoryWalker( IOFileFilter fileFilter, String firstLine, String linePrefix, String lastLine ) {
    super(HiddenFileFilter.VISIBLE,fileFilter,100);
    this.firstLine = firstLine;
    this.linePrefix = linePrefix;
    this.lastLine = lastLine;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:7,代码来源:LicenseHeaderUpdate.java

示例15: defaultDirectoryFilter

import org.apache.commons.io.filefilter.HiddenFileFilter; //导入依赖的package包/类
/**
 * Limit directories to visible directories
 *
 * @return
 */
public static IOFileFilter defaultDirectoryFilter() {
    return FileFilterUtils.and(
            FileFilterUtils.directoryFileFilter(),
            HiddenFileFilter.VISIBLE);
}
 
开发者ID:semperos,项目名称:screwdriver,代码行数:11,代码来源:FileUtil.java


注:本文中的org.apache.commons.io.filefilter.HiddenFileFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。