Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
File Name and Extension
Mark_Bastin_(mbastin_-_(deleted))
Hi,How would I extract extract a documents name and type (extension) using LAPI in Java?Regards
Find more posts tagged with
Comments
Louis_Routhier
Sorry, my JAVA is too far away to give it to you in this language but here is a VB.NET sample to extract extensiondim iVolumeID as integer = -2000dim iNodeID=2000dim oLLValue as LLValue = new LLValue.setAssocNotSet()dim DocAPI as New LAPI_DOCUMENTS(Me.Session)dim Filename as String = DocumentsAPI.GetObjectInfo(iVolumeID, iNodeID, oLLValue).toString("Name")Dim sResult As String = String.EmptyDim iPos As Integer = Filename.LastIndexOf(".")If (iPos > 0) Then sResult = Filename.Substring(iPos + 1)End IfReturn sResult
Mark_Bastin_(mbastin_-_(deleted))
Thanks for the example - It did actually help.This is what I have done in Java: (just a snippet of the code) //document object creation information LLValue objectInfo = (new LLValue()).setAssocNotSet(); //document file creation information LLValue fileInfo = (new LLValue()).setAssocNotSet(); //document version creation information LLValue versionInfo = (new LLValue()).setAssocNotSet(); //livelink workspace info LLValue workSpaceInfo = new LLValue().setAssocNotSet(); //access workspace to get volumeID ldocs.AccessEnterpriseWS(workSpaceInfo); int parentVol = workSpaceInfo.toInteger("VolumeID"); //add document to livelink int status = ldocs.AddDocument( parentVol, folderId, documentName, "", documentContent, documentContent.available(), fileInfo, objectInfo, versionInfo );//get document nameString name = objectInfo.toString("Name");