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


Java PseudoFileList.addFile方法代码示例

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


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

示例1: existingPseudoFileList

import org.alfresco.jlan.server.filesys.pseudo.PseudoFileList; //导入方法依赖的package包/类
private PseudoFileList existingPseudoFileList(final String path) {
    final PseudoFileList pseudoFileList = _pseudoFileLists.get(path);
    if (pseudoFileList != null) {
        return pseudoFileList;
    }

    final PseudoFileList newPseudoFileList = new PseudoFileList();
    _pseudoFileLists.put(path, newPseudoFileList);

    // TODO: (see RAQET-36) Remove hack for bug in PseudoFileList when reimplementing the disk driver.
    newPseudoFileList.addFile(new MemoryPseudoFile("123.txt", new byte[]{1, 2, 3}));

    return newPseudoFileList;
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:15,代码来源:RaqetDiskDriver.java

示例2: addRemoteDevice

import org.alfresco.jlan.server.filesys.pseudo.PseudoFileList; //导入方法依赖的package包/类
public void addRemoteDevice(final RemoteDeviceManager remoteDeviceManager, final String folder, final RemoteDeviceInfo remoteDevice) {
    final PseudoFileList pseudoFileList = existingPseudoFileList(folder);
    pseudoFileList.addFile(new RemotePseudoFile(remoteDeviceManager, remoteDevice));
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:5,代码来源:RaqetDiskDriver.java

示例3: startSearch

import org.alfresco.jlan.server.filesys.pseudo.PseudoFileList; //导入方法依赖的package包/类
@Override
public SearchContext startSearch(final SrvSession sess, final TreeConnection tree, final String searchPath, final int attrib) throws FileNotFoundException {
	SearchContext searchContext;
	try {
		searchContext = super.startSearch(sess, tree, searchPath, attrib);
	} catch (FileNotFoundException exception) {
		searchContext = null;
	}
    
    int lastSlash = searchPath.lastIndexOf("\\");
    if (lastSlash < 1) {
    	return searchContext;
    }
    final String path = searchPath.substring(0, lastSlash+1);
    final String pattern = searchPath.substring(lastSlash+1);
    final RaqetSearchContext raqetSearchContext = new RaqetSearchContext(searchContext, path);
    
    final PseudoFileList pseudoFileList = _pseudoFileLists.get(path);
    if (pseudoFileList == null) {
    	return searchContext;
    }
    
    if (pattern.equals("*")) {
        raqetSearchContext.setPseudoFileList(pseudoFileList);
    } else {
        final PseudoFileList newPseudoFileList = new PseudoFileList();
        newPseudoFileList.addFile(new MemoryPseudoFile("123.txt", new byte[]{1, 2, 3}));
    	for (int i=0; i < pseudoFileList.numberOfFiles(); i++) {
    		PseudoFile pseudoFile = pseudoFileList.getFileAt(i);
    		if (pseudoFile.getFileName().equals(pattern)) {
    			newPseudoFileList.addFile(pseudoFile);
    		} else {
    		}
    	}
    	if ((searchContext == null) && 
    		(newPseudoFileList.numberOfFiles() == 1)) {
    		throw new FileNotFoundException();
    	}
        raqetSearchContext.setPseudoFileList(newPseudoFileList);
    }
    

    return raqetSearchContext;
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:45,代码来源:RaqetDiskDriver.java


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