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


Java FileOpenParams.getSharedAccess方法代码示例

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


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

示例1: 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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:67,代码来源:NonTransactionalRuleContentDiskDriver.java


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