本文整理汇总了Java中org.apache.commons.vfs.FileSelectInfo类的典型用法代码示例。如果您正苦于以下问题:Java FileSelectInfo类的具体用法?Java FileSelectInfo怎么用?Java FileSelectInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileSelectInfo类属于org.apache.commons.vfs包,在下文中一共展示了FileSelectInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info)
{
boolean returncode=false;
try
{
if (!info.getFile().toString().equals(source_folder))
{
// Pass over the Base folder itself
String short_filename= info.getFile().getName().getBaseName();
if (info.getFile().getParent().equals(info.getBaseFolder()) ||
(!info.getFile().getParent().equals(info.getBaseFolder()) && includeSubfolders))
{
if((info.getFile().getType() == FileType.FILE && file_wildcard==null) ||
(info.getFile().getType() == FileType.FILE && file_wildcard!=null && GetFileWildcard(short_filename,file_wildcard)))
returncode=true;
}
}
}
catch (Exception e)
{
log.logError(toString(), "Error while finding files ... in [" + info.getFile().toString() + "]. Exception :"+e.getMessage());
returncode= false;
}
return returncode;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:JobEntryAddResultFilenames.java
示例2: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info)
{
boolean returncode=false;
try
{
if (!info.getFile().toString().equals(source_folder))
{
// Pass over the Base folder itself
String short_filename= info.getFile().getName().getBaseName();
if (info.getFile().getParent().equals(info.getBaseFolder()) ||
((!info.getFile().getParent().equals(info.getBaseFolder()) && meta.isIncludeSubFolders())))
{
if((info.getFile().getType() == FileType.FILE && file_wildcard==null) ||
(info.getFile().getType() == FileType.FILE && file_wildcard!=null && GetFileWildcard(short_filename,file_wildcard)))
returncode=true;
}
}
}
catch (Exception e)
{
log.logError(toString(), Messages.getString("Mail.Error.FindingFiles", info.getFile().toString(),e.getMessage()));
returncode= false;
}
return returncode;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:Mail.java
示例3: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info)
{
boolean returncode=false;
try
{
if (!info.getFile().toString().equals(source_folder))
{
// Pass over the Base folder itself
String short_filename= info.getFile().getName().getBaseName();
if (info.getFile().getParent().equals(info.getBaseFolder()) ||
(!info.getFile().getParent().equals(info.getBaseFolder()) && includeSubfolders))
{
if((info.getFile().getType() == FileType.FILE && file_wildcard==null) ||
(info.getFile().getType() == FileType.FILE && file_wildcard!=null && GetFileWildcard(short_filename,file_wildcard)))
returncode=true;
}
}
}
catch (Exception e)
{
logError("Error while finding files ... in [" + info.getFile().toString() + "]. Exception :"+e.getMessage());
returncode= false;
}
return returncode;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:JobEntryAddResultFilenames.java
示例4: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info)
{
boolean returncode=false;
try
{
if (!info.getFile().toString().equals(source_folder))
{
// Pass over the Base folder itself
String short_filename= info.getFile().getName().getBaseName();
if (info.getFile().getParent().equals(info.getBaseFolder()) ||
((!info.getFile().getParent().equals(info.getBaseFolder()) && meta.isIncludeSubFolders())))
{
if((info.getFile().getType() == FileType.FILE && file_wildcard==null) ||
(info.getFile().getType() == FileType.FILE && file_wildcard!=null && GetFileWildcard(short_filename,file_wildcard)))
returncode=true;
}
}
}
catch (Exception e)
{
logError(BaseMessages.getString(PKG, "Mail.Error.FindingFiles", info.getFile().toString(),e.getMessage()));
returncode= false;
}
return returncode;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:Mail.java
示例5: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
/**
* Determines if a file or folder should be selected.
*/
public boolean includeFile(final FileSelectInfo fileInfo)
throws FileSystemException
{
final FileObject file = fileInfo.getFile();
if (file == currentFolder)
{
// Pop current folder
assertEquals(0, children.size());
currentFolder = currentFolder.getParent();
currentFolderInfo = currentFolderInfo.getParent();
children = (Set) stack.remove(0);
}
final String baseName = file.getName().getBaseName();
final FileInfo childInfo = getChild(baseName);
assertSame(childInfo.type, file.getType());
final boolean isChild = children.remove(baseName);
assertTrue(isChild);
files.add(file);
return true;
}
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:28,代码来源:VerifyingFileSelector.java
示例6: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean includeFile(FileSelectInfo fileSelectInfo) throws FileSystemException
{
if (fileSelectInfo.getFile().isHidden())
{
return false;
}
return super.includeFile(fileSelectInfo);
}
开发者ID:strator-dev,项目名称:greenpepper,代码行数:11,代码来源:NotHiddenFileTypeSelector.java
示例7: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean traverseDescendents(FileSelectInfo fileSelectInfo)
{
try
{
if (fileSelectInfo.getFile().isHidden())
{
return false;
}
}
catch (FileSystemException e) {}
return super.traverseDescendents(fileSelectInfo);
}
开发者ID:strator-dev,项目名称:greenpepper,代码行数:16,代码来源:NotHiddenFileTypeSelector.java
示例8: checkConflicts
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
/**
* Check whether a lock conflicts with already existing locks up and down the path.
* First we go up the path to check for parent locks that may include the file object
* and the go down the directory tree (if depth requires it) to check locks that
* will conflict.
*
* @param requestedLock the lock requested
* @throws LockConflictException if a conflicting lock was found
* @throws FileSystemException if the file object or path cannot be accessed
*/
private void checkConflicts(final Lock requestedLock) throws LockConflictException, FileSystemException {
// find locks in the parent path
FileObject parent = requestedLock.getObject();
while (parent != null) {
List<Lock> parentLocks = lockMap.get(parent);
if (parentLocks != null && !parentLocks.isEmpty()) {
for (Lock parentLock : parentLocks) {
if (Lock.EXCLUSIVE.equals(requestedLock.getScope()) || Lock.EXCLUSIVE.equals(parentLock.getScope())) {
throw new LockConflictException(parentLocks);
}
}
}
parent = parent.getParent();
}
// look for locks down the path (if depth requests it)
if (requestedLock.getDepth() != 0 && requestedLock.getObject().getChildren().length > 0) {
requestedLock.getObject().findFiles(new DepthFileSelector(1, requestedLock.getDepth()) {
public boolean includeFile(FileSelectInfo fileSelectInfo) throws Exception {
List<Lock> childLocks = lockMap.get(fileSelectInfo.getFile());
for (Lock childLock : childLocks) {
if (Lock.EXCLUSIVE.equals(requestedLock.getScope()) || Lock.EXCLUSIVE.equals(childLock.getScope())) {
throw new LockConflictException(childLocks);
}
}
return false;
}
}, false, new ArrayList());
}
}
开发者ID:thinkberg,项目名称:moxo,代码行数:41,代码来源:LockManager.java
示例9: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
/**
* Determines whether a folder should be traversed.
*/
public boolean traverseDescendents(final FileSelectInfo fileInfo)
throws FileSystemException
{
// Check that the given file is a folder
final FileObject folder = fileInfo.getFile();
assertSame(FileType.FOLDER, folder.getType());
// Locate the info for the folder
final String baseName = folder.getName().getBaseName();
if (currentFolder == null)
{
assertEquals(rootFile.baseName, baseName);
currentFolderInfo = rootFile;
}
else
{
assertSame(currentFolder, folder.getParent());
// Locate the info for the child, and make sure it is folder
currentFolderInfo = getChild(baseName);
assertSame(FileType.FOLDER, currentFolderInfo.type);
}
// Push the folder
stack.add(0, children);
children = new HashSet(currentFolderInfo.children.keySet());
currentFolder = folder;
return true;
}
开发者ID:pentaho,项目名称:pdi-vfs,代码行数:34,代码来源:VerifyingFileSelector.java
示例10: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo fileSelectInfo) throws Exception {
int depth = fileSelectInfo.getDepth();
return depth >= minDepth && depth <= maxDepth;
}
开发者ID:OpenBD,项目名称:openbd-core,代码行数:5,代码来源:DepthFileSelector.java
示例11: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean traverseDescendents(FileSelectInfo fileSelectInfo)
throws Exception {
return fileSelectInfo.getDepth() < maxDepth;
}
开发者ID:OpenBD,项目名称:openbd-core,代码行数:5,代码来源:DepthFileSelector.java
示例12: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo fileSelectInfo) throws Exception {
return true;
}
开发者ID:thinkberg,项目名称:moxo,代码行数:4,代码来源:DeleteHandler.java
示例13: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean traverseDescendents(FileSelectInfo fileSelectInfo) throws Exception {
return true;
}
开发者ID:thinkberg,项目名称:moxo,代码行数:4,代码来源:DeleteHandler.java
示例14: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo fileSelectInfo) throws Exception {
int depth = fileSelectInfo.getDepth();
return depth >= minDepth && depth <= maxDepth;
}
开发者ID:thinkberg,项目名称:moxo,代码行数:5,代码来源:DepthFileSelector.java
示例15: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean traverseDescendents(FileSelectInfo fileSelectInfo) throws Exception {
return fileSelectInfo.getDepth() < maxDepth;
}
开发者ID:thinkberg,项目名称:moxo,代码行数:4,代码来源:DepthFileSelector.java
示例16: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info)
{
boolean returncode=false;
FileObject file_name=null;
try
{
if (!info.getFile().toString().equals(root_folder))
{
// Pass over the Base folder itself
if ((info.getFile().getType() == FileType.FILE))
{
if (info.getFile().getParent().equals(info.getBaseFolder()))
{
// We are in the Base folder
if((isSpecifyWildcard() && GetFileWildcard(info.getFile().getName().getBaseName())) || !isSpecifyWildcard())
{
if(log.isDetailed()) log.logDetailed("Found files", "We found file : " + info.getFile().toString());
filescount++;
}
}
else
{
// We are not in the base Folder...ONLY if Use sub folders
// We are in the Base folder
if(isIncludeSubFolders())
{
if((isSpecifyWildcard() && GetFileWildcard(info.getFile().getName().getBaseName())) || !isSpecifyWildcard())
{
if(log.isDetailed()) log.logDetailed("Found files", "We found file : " + info.getFile().toString());
filescount++;
}
}
}
}
else
{
folderscount++;
}
}
return true;
}
catch (Exception e)
{
log.logError(Messages.getString("JobFolderIsEmpty.Error") ,
Messages.getString("JobFolderIsEmpty.Error.Exception",
info.getFile().toString(),e.getMessage()));
returncode= false;
}
finally
{
if ( file_name != null )
{
try
{
file_name.close();
}
catch ( IOException ex ) {};
}
}
return returncode;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:64,代码来源:JobEntryFolderIsEmpty.java
示例17: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean traverseDescendents(FileSelectInfo info)
{
return true;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:5,代码来源:JobEntryFolderIsEmpty.java
示例18: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info)
{
boolean returncode=false;
try
{
if (!info.getFile().toString().equals(source_folder))
{
// Pass over the Base folder itself
String short_filename= info.getFile().getName().getBaseName();
if (info.getFile().getParent().equals(info.getBaseFolder()))
{
// In the Base Folder...
if((info.getFile().getType() == FileType.FILE && compareonly.equals("only_files")) ||
(info.getFile().getType() == FileType.FOLDER && compareonly.equals("only_folders")) ||
(GetFileWildcard(short_filename) && compareonly.equals("specify") ) ||
(compareonly.equals("all")) )
returncode=true;
}
else
{
// Not in the Base Folder...Only if include sub folders
if(includesubfolders)
{
if((info.getFile().getType() == FileType.FILE && compareonly.equals("only_files")) ||
(info.getFile().getType() == FileType.FOLDER && compareonly.equals("only_folders")) ||
(GetFileWildcard(short_filename) && compareonly.equals("specify") ) ||
(compareonly.equals("all")) )
returncode=true;
}
}
}
}
catch (Exception e)
{
log.logError(toString(), "Error while finding files ... in [" + info.getFile().toString() + "]. Exception :"+e.getMessage());
returncode= false;
}
return returncode;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:47,代码来源:JobEntryFoldersCompare.java
示例19: includeFile
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean includeFile(FileSelectInfo info) {
return true;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:4,代码来源:JobEntryDeleteFolders.java
示例20: traverseDescendents
import org.apache.commons.vfs.FileSelectInfo; //导入依赖的package包/类
public boolean traverseDescendents(FileSelectInfo info) {
return true;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:4,代码来源:JobEntryDeleteFolders.java
注:本文中的org.apache.commons.vfs.FileSelectInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论