Here is my code snipped for serving file from GAE web app:
if(found){
rep = new FileRepresentation(path, MediaType.TEXT_PLAIN, 0);
} else {
rep = new StringRepresentation("no file uploaded",
MediaType.TEXT_PLAIN);
}
The problem here is that this throws:
[INFO] java.security.AccessControlException: access denied ("java.io.FilePermission" "/blobstore/writable:eQNiAZlrSRURFNdL_jApzB" "read")
[INFO] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
[INFO] at java.security.AccessController.checkPermission(AccessController.java:884)
[INFO] at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
[INFO] at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:431)
[INFO] at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
[INFO] at java.io.File.lastModified(File.java:938)
[INFO] at org.restlet.representation.FileRepresentation.<init>(FileRepresentation.java:118)
[INFO] at org.restlet.representation.FileRepresentation.<init>(FileRepresentation.java:160)
Is there a way to make FileRepresentation
work with GAE?