本文整理汇总了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;
}
}
示例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;
}
示例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;
}
}
示例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);
}