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