Changeset 5176
- Timestamp:
- 05/12/14 11:11:33 (10 years ago)
- Location:
- vlo/trunk/vlo-web-app/src
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/UrlFromStringModel.java
r4669 r5176 19 19 import java.io.File; 20 20 import java.net.MalformedURLException; 21 import java.net.URISyntaxException; 21 22 import java.net.URL; 22 23 import org.apache.wicket.model.IModel; 23 24 24 25 /** 26 * Model that wraps a model providing a file location and returns a URL for this 27 * location via {@link #getObject() } 25 28 * 26 29 * @author twagoo … … 30 33 private final IModel<String> model; 31 34 35 /** 36 * 37 * @param model model that provides a file location 38 */ 32 39 public UrlFromStringModel(IModel<String> model) { 33 40 this.model = model; … … 52 59 model.setObject(null); 53 60 } else { 54 model.setObject(object.toString()); 61 try { 62 model.setObject(new File(object.toURI()).getAbsolutePath()); 63 } catch (URISyntaxException ex) { 64 throw new RuntimeException(ex); 65 } 55 66 } 56 67 }
Note: See TracChangeset
for help on using the changeset viewer.