File response with GAE (Restlet)

4 views
Skip to first unread message

xybrek via StackOverflow

unread,
Sep 23, 2014, 4:04:47 AM9/23/14
to google-appengin...@googlegroups.com

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?



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/25989893/file-response-with-gae-restlet
Reply all
Reply to author
Forward
0 new messages