Wiki source code of !Test_file_path
Version 4.21 by Alexandru Colesnicov on 2019/10/02 14:26
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
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 | |||
![]() |
4.5 | 9 | att = doc.getAttachment("TestingData.xls") |
![]() |
4.21 | 10 | println ("att = doc.getAttachment(\"TestingData.xls\")") |
| 11 | println (" att: variable got its value") | ||
| 12 | println (" att: Class is " + att.getClass().getSimpleName() + " (" + att.getClass().getName() + ")") | ||
![]() |
4.12 | 13 | |
![]() |
4.13 | 14 | xwa = att.getAttachment() |
![]() |
4.21 | 15 | println ("xwa = att.getAttachment()") |
| 16 | println (" xwa: variable got its value") | ||
| 17 | println (" xwa: Class is " + xwa.getClass().getSimpleName() + " (" + xwa.getClass().getName() + ")") | ||
![]() |
4.13 | 18 | |
![]() |
4.15 | 19 | sfi = xwa.getAttachment_content().storageFile |
![]() |
4.21 | 20 | println ("sfi = xwa.getAttachment_content().storageFile") |
| 21 | println (" sfi: variable got its value") | ||
| 22 | println (" sfi: Class is " + sfi.getClass().getSimpleName() + " (" + sfi.getClass().getName() + ")") | ||
![]() |
4.15 | 23 | |
![]() |
4.20 | 24 | apa = sfi.getAbsolutePath() |
![]() |
4.21 | 25 | println ("apa = sfi.getAbsolutePath()") |
| 26 | println (" apa: variable got its value = " + apa) | ||
| 27 | println (" apa: Class is " + sfi.getClass().getSimpleName() + " (" + sfi.getClass().getName() + ")") | ||
![]() |
4.19 | 28 | |
| |
1.1 | 29 | {{/groovy}} |
