本文整理匯總了Java中org.alfresco.jlan.server.filesys.FileOpenParams.getAttributes方法的典型用法代碼示例。如果您正苦於以下問題:Java FileOpenParams.getAttributes方法的具體用法?Java FileOpenParams.getAttributes怎麽用?Java FileOpenParams.getAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.alfresco.jlan.server.filesys.FileOpenParams
的用法示例。
在下文中一共展示了FileOpenParams.getAttributes方法的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);
}
}