Added binding `path` for relative media path

This commit is contained in:
Reinhard Pointner 2016-10-09 18:33:34 +08:00
parent 4833391729
commit 8f1969b50b
1 changed files with 5 additions and 0 deletions

View File

@ -889,6 +889,11 @@ public class MediaBindingBean {
return SLASH.splitAsStream(MediaTypes.getDefault().getMediaType(getExtension())).collect(toList());
}
@Define("path")
public File getMediaPath() throws Exception {
return getStructurePathTail(getMediaFile());
}
@Define("f")
public File getMediaFile() {
// make sure file is not null, and that it is an existing file