Hide last authors
etvc developer 1.1 1 {{groovy}}
2 import com.xpn.xwiki.*;
3 import com.xpn.xwiki.api.*;
4 import com.xpn.xwiki.doc.*;
5 import org.apache.commons.io.FileUtils;
6 import java.io.File;
7 import java.net.URL;
8
9 // y=XWikiAttachment(xwiki.getDocument(doc.parent), "aFileVerified").getAttachment_content().storageFile;
10 //y=xwiki.getDocument(doc.parent).XWikiAttachment.getAttachment_content().storageFile;
Alexandru Colesnicov 4.12 11
Alexandru Colesnicov 4.5 12 att = doc.getAttachment("TestingData.xls")
Alexandru Colesnicov 4.11 13 println (att.getClass().getSimpleName() + " (" + att.getClass().getName() + ")")
Alexandru Colesnicov 4.12 14
Alexandru Colesnicov 4.13 15 xwa = att.getAttachment()
16 println (xwa.getClass().getSimpleName() + " (" + xwa.getClass().getName() + ")")
17
Alexandru Colesnicov 4.15 18 sfi = xwa.getAttachment_content().storageFile
19 println (sfi.getClass().getSimpleName() + " (" + sfi.getClass().getName() + ")")
20
Alexandru Colesnicov 4.8 21 //aco = att.getAttachment_content()
Alexandru Colesnicov 4.12 22
etvc developer 1.1 23 // for (XWikiAttachment attach in doc.getAttachmentList()) {
24 // println "** " + attach.filename;
25 // }
26 //println y;
27 {{/groovy}}