public boolean accept(final FileSelectInfo selection) { assert selection != null; try { return !selection.getFile().isHidden(); } catch (FileSystemException e) { throw new RuntimeException(e); } } };
/** * @see org.apache.commons.vfs.FileSelector#includeFile(org.apache.commons.vfs.FileSelectInfo) */ public boolean includeFile(FileSelectInfo info) throws Exception { FileObject file = info.getFile(); return file.getName().toString().matches(this.regex); }
public boolean accept(final FileSelectInfo selection) { assert selection != null; try { return !selection.getFile().isHidden(); } catch (FileSystemException e) { throw new RuntimeException(e); } } };
/** * Determines if a file or folder should be selected. */ public boolean includeFile(final FileSelectInfo fileInfo) throws FileSystemException { return (fileInfo.getFile().getType() == type); }
public boolean includeFile(final FileSelectInfo selection) throws Exception { assert selection != null; FileType ftype = selection.getFile().getType(); switch (type) { case D: return ftype == FileType.FOLDER; case F: return ftype == FileType.FILE; // TODO: Handle FileType.FILE_OR_FOLDER default: return false; } }
public boolean includeFile(final FileSelectInfo selection) throws Exception { assert selection != null; FileType ftype = selection.getFile().getType(); switch (type) { case D: return ftype == FileType.FOLDER; case F: return ftype == FileType.FILE; // TODO: Handle FileType.FILE_OR_FOLDER default: return false; } }
/** * @see org.apache.commons.vfs.FileSelector#includeFile(org.apache.commons.vfs.FileSelectInfo) */ public boolean includeFile(FileSelectInfo fileInfo) throws Exception { File folder = archiveFile.getParentFile(); String name = fileInfo.getFile().getName().getFriendlyURI(); return filter.accept(folder, name); } };
@Override public boolean includeFile(FileSelectInfo fileInfo) { LOGGER.fine("Uncompressing " + fileInfo.getFile().getName().getFriendlyURI()); return true; } };
/** * @see org.apache.commons.vfs.FileSelector#includeFile(org.apache.commons.vfs.FileSelectInfo) */ public boolean includeFile(FileSelectInfo info) throws Exception { boolean accept = false; try { SAXReader reader = new SAXReader(); FileObject file = info.getFile(); byte[] content = FileUtil.getContent(file); ByteArrayInputStream is = new ByteArrayInputStream(content); Document document = reader.read(is); List nodelist = document.selectNodes(this.path); accept = (nodelist.size() > 0); } catch (Throwable th) { th.printStackTrace(); } return accept; }
/** * @see org.apache.commons.vfs.FileSelector#includeFile(org.apache.commons.vfs.FileSelectInfo) */ public boolean includeFile( FileSelectInfo fileInfo ) { String fileName = fileInfo.getFile().getName().getBaseName(); return matcher.matches( fileName, pattern ); }
public boolean includeFile(final FileSelectInfo selection) throws Exception { assert selection != null; return matcher.matches(selection.getFile().getName().getBaseName(), pattern); }
public boolean includeFile(final FileSelectInfo selection) throws Exception { assert selection != null; return matcher.matches(selection.getFile().getName().getBaseName(), pattern); }
public boolean includeFile( FileSelectInfo fileSelectInfo ) throws Exception { FileObject fileObject = fileSelectInfo.getFile(); FileName name = fileObject.getName(); if ( fileType != null && fileObject.getType() != fileType ) { return false; } String relativePath = root.getRelativeName( name ); return matches( relativePath ); }