Hi All!
I would like to upload a file with UCF on DFS 6.5.
Is it necessary for the content to be UcfContent or can it be of type DataHandlerContent?
I haven't found too much documentation about creating UcfContent, so I assume, that filePath in the code above represents the local path based on which the File object can be instantiated.
UcfContent ucfContent = new UcfContent();
ucfContent.setContentTransferMode(ContentTransferMode.UCF);
ucfContent.setFormat(format);
ucfContent.setLocalFilePath(filePath);
However my create call fails, and I extracted the following fragment from the 500 response:
<exceptionClass>com.emc.documentum.fs.rt.ServiceInvocationException</exceptionClass><genericType>java.lang.Exception</genericType><message>File not found "/dms/dctm/shared/jboss4.2.0/server/c:/Users/myuser/Documents/NetBeansProjects/DokufunnelBasic/res/tomcat.gif"</message><messageId>E_CONTENT_DOES_NOT_EXIST</messageId>
It concatenated a server path with my filePath which is the latter one...
The following UCF init code might be relevant:
UcfConnection connection = new UcfConnection(ucfServerUrl); String jsessionId = connection.getJsessionId(); // = req.getParameter("jsessionId"); logger.log(Level.CONFIG, "JSessionID is: {0}", jsessionId); String uid = connection.getUid(); // = req.getParameter("uid"); logger.log(Level.CONFIG, "uID is: {0}", uid); activityInfo = new ActivityInfo(); activityInfo.setActivityId(uid); activityInfo.setSessionId(jsessionId); activityInfo.setAutoCloseConnection(false); ContentTransferProfile ct = new ContentTransferProfile(); ct.setTransferMode(ContentTransferMode.UCF); ct.setActivityInfo(activityInfo); ServiceContext serviceCtx = ServiceContextManager.getServiceContext(); if (serviceCtx != null) { serviceCtx.getProfiles().clear(); serviceCtx.getProfiles().add(ct); } ServiceContextManager.registerContext();
Could someone please help me?
Thanks!