本文整理汇总了Java中org.alfresco.jlan.server.filesys.FileOpenParams.getPath方法的典型用法代码示例。如果您正苦于以下问题:Java FileOpenParams.getPath方法的具体用法?Java FileOpenParams.getPath怎么用?Java FileOpenParams.getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.jlan.server.filesys.FileOpenParams
的用法示例。
在下文中一共展示了FileOpenParams.getPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDirectory
import org.alfresco.jlan.server.filesys.FileOpenParams; //导入方法依赖的package包/类
@Override
public void createDirectory(SrvSession sess, TreeConnection tree,
FileOpenParams params) throws IOException
{
try
{
FileFilterMode.setClient(ClientHelper.getClient(sess));
try
{
diskInterface.createDirectory(sess, tree, params);
}
finally
{
FileFilterMode.clearClient();
}
}
catch(org.alfresco.repo.security.permissions.AccessDeniedException ade)
{
throw new AccessDeniedException("Unable to create directory " + params.getPath(), ade);
}
}
示例2: openFile
import org.alfresco.jlan.server.filesys.FileOpenParams; //导入方法依赖的package包/类
@Override
public NetworkFile openFile(final SrvSession sess, final TreeConnection tree, final FileOpenParams params) throws IOException {
if (params != null) {
final String path = params.getPath();
final PseudoFile pseudoFile = findPseudoFile(path);
if (pseudoFile != null) {
return pseudoFile.getFile(path);
}
}
return super.openFile(sess, tree, params);
}
示例3: createFile
import org.alfresco.jlan.server.filesys.FileOpenParams; //导入方法依赖的package包/类
@Override
public NetworkFile createFile(SrvSession sess, TreeConnection tree,
FileOpenParams params) throws IOException
{
try
{
int attr = params.getAttributes();
if(logger.isDebugEnabled())
{
int sharedAccess = params.getSharedAccess();
String strSharedAccess = SharingMode.getSharingModeAsString(sharedAccess);
logger.debug("createFile:" + params.getPath()
+ ", isDirectory: " + params.isDirectory()
+ ", isStream: " + params.isStream()
+ ", readOnlyAccess: " + params.isReadOnlyAccess()
+ ", readWriteAccess: " + params.isReadWriteAccess()
+ ", writeOnlyAccess:" +params.isWriteOnlyAccess()
+ ", attributesOnlyAccess:" +params.isAttributesOnlyAccess()
+ ", sequentialAccessOnly:" + params.isSequentialAccessOnly()
+ ", requestBatchOpLock:" +params.requestBatchOpLock()
+ ", requestExclusiveOpLock:" +params.requestExclusiveOpLock()
+ ", isDeleteOnClose:" +params.isDeleteOnClose()
+ ", sharedAccess: " + strSharedAccess
+ ", allocationSize: " + params.getAllocationSize()
+ ", isHidden:" + FileAttribute.isHidden(attr)
+ ", isSystem:" + FileAttribute.isSystem(attr));
}
long creationDateTime = params.getCreationDateTime();
if(creationDateTime != 0)
{
logger.debug("creationDateTime is set:" + new Date(creationDateTime));
}
ContentContext tctx = (ContentContext) tree.getContext();
NodeRef rootNode = tctx.getRootNode();
String[] paths = FileName.splitPath(params.getPath());
String folder = paths[0];
String file = paths[1];
DriverState driverState = getDriverState(sess);
EvaluatorContext ctx = getEvaluatorContext(driverState, folder);
Operation o = new CreateFileOperation(file, rootNode, params.getPath(), params.getAllocationSize(), FileAttribute.isHidden(attr));
Command c = ruleEvaluator.evaluate(ctx, o);
Object ret = commandExecutor.execute(sess, tree, c);
if(ret != null && ret instanceof NetworkFile)
{
return (NetworkFile)ret;
}
else
{
// Error - contact broken
logger.error("contract broken - NetworkFile not returned. " + ret == null ? "Return value is null" : ret);
return null;
}
}
catch(org.alfresco.repo.security.permissions.AccessDeniedException ade)
{
throw new AccessDeniedException("Unable to create file " + params.getPath(), ade);
}
}