本文整理汇总了Java中org.alfresco.jlan.server.filesys.pseudo.MemoryPseudoFile类的典型用法代码示例。如果您正苦于以下问题:Java MemoryPseudoFile类的具体用法?Java MemoryPseudoFile怎么用?Java MemoryPseudoFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemoryPseudoFile类属于org.alfresco.jlan.server.filesys.pseudo包,在下文中一共展示了MemoryPseudoFile类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateAlfrescoURLShortcut
import org.alfresco.jlan.server.filesys.pseudo.MemoryPseudoFile; //导入依赖的package包/类
private PseudoFile generateAlfrescoURLShortcut(NodeRef nodeRef)
{
if ( context.isAlfrescoURLEnabled())
{
// Make sure the state has the associated node details
// Build the URL file data
StringBuilder urlStr = new StringBuilder();
urlStr.append("[InternetShortcut]\r\n");
urlStr.append("URL=");
urlStr.append(getAlfrescoURLPrefix());
urlStr.append("navigate/browse/workspace/SpacesStore/");
urlStr.append( nodeRef.getId());
urlStr.append("\r\n");
// Create the in memory pseudo file for the URL link
byte[] urlData = urlStr.toString().getBytes();
MemoryPseudoFile urlFile = new MemoryPseudoFile( context.getURLFileName(), urlData);
return urlFile;
}
return null;
}
示例2: existingPseudoFileList
import org.alfresco.jlan.server.filesys.pseudo.MemoryPseudoFile; //导入依赖的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;
}
示例3: generateShareURLShortcut
import org.alfresco.jlan.server.filesys.pseudo.MemoryPseudoFile; //导入依赖的package包/类
private PseudoFile generateShareURLShortcut(NodeRef nodeRef)
{
if(logger.isDebugEnabled())
{
logger.debug("generateShareURLShortcut nodeRef" + nodeRef);
}
if ( context.isShareURLEnabled())
{
String site = getSiteForNode(nodeRef);
if(site != null)
{
// Make sure the state has the associated node details
// Build the URL file data
StringBuilder urlStr = new StringBuilder();
// This is the URL generated
// http://markr:8080/share/page/site/wibble/folder-details?nodeRef=workspace://SpacesStore/f72b2475-7571-46fe-947b-b0ee1b6a82ea
urlStr.append("[InternetShortcut]\r\n");
urlStr.append("URL=");
urlStr.append(getShareURLPrefix());
urlStr.append("page/site/");
urlStr.append(site + "/folder-details?nodeRef=");
urlStr.append(nodeRef.getStoreRef() + "/");
urlStr.append( nodeRef.getId());
urlStr.append("\r\n");
// Should this be the URL instead
// http://markr:8080/share/page/site/wibble/documentlibrary#filter=path%7C%2Ffolder%2520A%2FFolderB&page=1
// Create the in memory pseudo file for the URL link
if(logger.isDebugEnabled())
{
logger.debug("generateShareURLShortcut url as string:" + urlStr);
}
byte[] urlData = urlStr.toString().getBytes();
MemoryPseudoFile urlFile = new MemoryPseudoFile( context.getShareURLFileName(), urlData);
return urlFile;
}
}
return null;
}
示例4: startSearch
import org.alfresco.jlan.server.filesys.pseudo.MemoryPseudoFile; //导入依赖的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;
}