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


Java FileType.equals方法代码示例

本文整理汇总了Java中org.apache.commons.vfs2.FileType.equals方法的典型用法代码示例。如果您正苦于以下问题:Java FileType.equals方法的具体用法?Java FileType.equals怎么用?Java FileType.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.vfs2.FileType的用法示例。


在下文中一共展示了FileType.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onChildrenChanged

import org.apache.commons.vfs2.FileType; //导入方法依赖的package包/类
/**
 * Called when the children of this file change.
 * 
 * @param child the child
 * @param newType the new type
 */
@Override
protected void onChildrenChanged(FileName child, FileType newType) {
    if (children != null && newType.equals(FileType.IMAGINARY)) {
        try {
            children.remove(UriParser.decode(child.getBaseName()));
        } catch (FileSystemException e) {
            throw new RuntimeException(e.getMessage());
        }
    } else {
        // if child was added we have to rescan the children
        children = null;
    }
}
 
开发者ID:clstoulouse,项目名称:motu,代码行数:20,代码来源:GsiFtpFileObject.java

示例2: compareTypes

import org.apache.commons.vfs2.FileType; //导入方法依赖的package包/类
private int compareTypes(FileType type1, FileType type2) {
  if (type1.equals(FileType.FILE) && !type2.equals(FileType.FILE)) {
    return 1;
  } else if (!type1.equals(FileType.FILE) && type2.equals(FileType.FILE)) {
    return -1;
  }
  return 0;
}
 
开发者ID:otros-systems,项目名称:otroslogviewer,代码行数:9,代码来源:FileObjectComparator.java

示例3: onChildrenChanged

import org.apache.commons.vfs2.FileType; //导入方法依赖的package包/类
/**
 * Called when the children of this file change.
 */
@Override
protected void onChildrenChanged(FileName child, FileType newType)
{
    if (children != null && newType.equals(FileType.IMAGINARY)) {
        if (!(children.isEmpty())) {
            try {
                if (children.containsKey(UriParser.decode(child.getBaseName()))) {
                    children.remove(UriParser.decode(child.getBaseName()));
                } else {
                    if (log.isDebugEnabled()) {
                        log.debug("Map does not contain the " + child.getBaseName() + "in the map");
                    }
                }
            } catch (FileSystemException e) {
                throw new RuntimeException(e.getMessage());
            }
        } else {
            if (log.isDebugEnabled()) {
                log.debug("EMPTY_FTP_FILE_MAP returned empty collection.");
            }
        }
    } else
    {
        // if child was added we have to rescan the children
        // TODO - get rid of this
        children = null;
    }
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:32,代码来源:FtpFileObject.java

示例4: childrenChanged

import org.apache.commons.vfs2.FileType; //导入方法依赖的package包/类
/**
 * Notifies the file that its children have changed.
 * @param childName The name of the child.
 * @param newType The type of the child.
 * @throws Exception if an error occurs.
 */
protected void childrenChanged(FileName childName, FileType newType) throws Exception
{
    // TODO - this may be called when not attached

    if (children != null)
    {
        if (childName != null && newType != null)
        {
            // TODO - figure out if children[] can be replaced by list
            ArrayList<FileName> list = new ArrayList<FileName>(Arrays.asList(children));
            if (newType.equals(FileType.IMAGINARY))
            {
                list.remove(childName);
            }
            else
            {
                list.add(childName);
            }
            children = new FileName[list.size()];
            list.toArray(children);
        }
    }

    // removeChildrenCache();
    onChildrenChanged(childName, newType);
}
 
开发者ID:wso2,项目名称:wso2-commons-vfs,代码行数:33,代码来源:AbstractFileObject.java


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