google app engine - java.security.AccessControlException: File accessible thru browser but not within same server -


so not repeat myself much, please refer serve static image along side java google-enpoint api.

as can see referenced link, able view image through url. however, when trying read filenames using similar code to

public void listfilesforfolder(final file folder) {     (final file fileentry : folder.listfiles()) {         if (fileentry.isdirectory()) {             listfilesforfolder(fileentry);         } else {             system.out.println(fileentry.getname());         }     } }  final file folder = new file("/home/you/desktop"); listfilesforfolder(folder); 

i security exception

java.security.accesscontrolexception: access denied ("java.io.filepermission" "/myimages" "read") 

does know fix? how come call thru browser show image , yet call within server throws exception? find strange.

if you've configured file "static" resource, it'll served separate pool of servers optimized serving static content. consequence file isn't available opened app. "resource" files available app open , read.

that's documented here.

you'll need use relative path when opening resource. you've shown absolute path above.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -