Hi,

Is there a way i can use to get the same guard object protecting multiple
resources ? i tried using this but without hope

 @Override
    public synchronized Restlet createRoot() {

        Router router = new Router(getContext());
        Guard testGuard = new Guard(getContext(),
ChallengeScheme.HTTP_BASIC, "Adding Access Control");        

        testGuard.getSecrets().put("uname","passwd".toCharArray());
        testGuard.setNext(FileUploader.class);
        testGuard.setNext(FileDownloader.class);
        testGuard.setNext(MainPage.class);
        
        // Defines routes
        router.attach("/myapp/main", testGuard);   
        router.attach("/obama/uploadfile", testGuard);
        router.attach("/obama/getfile", testGuard);
        return router;
    }

that didn't work of course, i need to know how to do it (may be via a realm,
but i don't know how to define realms)

Thanks 

-- 
View this message in context: 
http://n2.nabble.com/Guarding-multiple-Resources-tp2017902p2017902.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=994245

Reply via email to