• Solution in 4 steps

att = doc.getAttachment("TestingData.xls")
    att: variable got its value
    att: Class is Attachment (com.xpn.xwiki.api.Attachment)
xwa = att.getAttachment()
    xwa: variable got its value
    xwa: Class is XWikiAttachment (com.xpn.xwiki.doc.XWikiAttachment)
sfi = xwa.getAttachment_content().storageFile
    sfi: variable got its value
    sfi: Class is File (java.io.File)
apa = sfi.getAbsolutePath()
    apa: variable got its value = /var/lib/xwiki/data/store/file/xwiki/6/e/b715ae6538cf07176fb4f163d58ae5/attachments/3/1/dfd9b66940a7ac2cf91860a111399a/f.xls
    apa: Class is String (java.lang.String)

  • Solution in 1 step

apa2 = doc.getAttachment("TestingData.xls").getAttachment().getAttachment_content().storageFile.getAbsolutePath()
    apa2: variable got its value = /var/lib/xwiki/data/store/file/xwiki/6/e/b715ae6538cf07176fb4f163d58ae5/attachments/3/1/dfd9b66940a7ac2cf91860a111399a/f.xls
    apa2: Class is String (java.lang.String)

Tags:
Created by etvc developer on 2019/09/30 10:41