Package org.restlet.data

Examples of org.restlet.data.ChallengeResponse


        return result;
    }

    @Override
    public ChallengeResponse getChallengeResponse() {
        ChallengeResponse result = super.getChallengeResponse();

        if (!this.securityAdded) {
            if (getHeaders() != null) {
                // Extract the header value
                String authorization = getHeaders().getValues(
View Full Code Here


                HeaderConstants.ATTRIBUTE_HEADERS);
    }

    @Override
    public ChallengeResponse getProxyChallengeResponse() {
        ChallengeResponse result = super.getProxyChallengeResponse();

        if (!this.proxySecurityAdded) {
            if (getHeaders() != null) {
                // Extract the header value
                final String authorization = getHeaders().getValues(
View Full Code Here

   }

   public void testUsers() {
      Client client = new Client(new Context(),adminUserLoc.getSchemeProtocol()) {
         public void handle(Request request,Response response) {
            request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,"admin","admin"));
            super.handle(request,response);
         }
      };
     
      Response response = client.handle(makePost(adminUserLoc,new StringRepresentation("<user xmlns='http://www.atomojo.org/Vocabulary/Admin/2007/1/0' alias='testuser.1' password='mypassword.1'/>",MediaType.APPLICATION_XML)));
View Full Code Here

     
      config.startServer();
     
      Client client = new Client(new Context(),config.getServerLocation().getSchemeProtocol()) {
         public void handle(Request request,Response response) {
            request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,"admin","admin"));
            super.handle(request,response);
         }
      };
     
      Reference rootFeed = new Reference(config.getServerLocation()+"R/");
View Full Code Here

   }
  
   public boolean exists() {
      Request request = new Request(Method.HEAD,location.toString());
      if (identity!=null) {
         request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,identity.getName(),identity.getPassword()));
      }
      if (cookie!=null) {
         request.getCookies().add(cookie);
      }
      Response response = locClient.handle(request);
View Full Code Here

   }
  
   public Status delete() {
      Request request = new Request(Method.DELETE,location.toString());
      if (identity!=null) {
         request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,identity.getName(),identity.getPassword()));
      }
      if (cookie!=null) {
         request.getCookies().add(cookie);
      }
      Response response = locClient.handle(request);
View Full Code Here

   }
  
   public Response get() {
      Request request = new Request(Method.GET,location.toString());
      if (identity!=null) {
         request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,identity.getName(),identity.getPassword()));
      }
      if (cookie!=null) {
         request.getCookies().add(cookie);
      }
      return locClient.handle(request);
View Full Code Here

   }
   public Status create(String xml)
   {
      Request request = new Request(Method.POST,location.toString());
      if (identity!=null) {
         request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,identity.getName(),identity.getPassword()));
      }
      if (cookie!=null) {
         request.getCookies().add(cookie);
      }
      request.setEntity(new StringRepresentation(xml,MediaType.APPLICATION_ATOM_XML));
View Full Code Here

   }
   public Status update(String xml)
   {
      Request request = new Request(Method.PUT,editURI.toString());
      if (identity!=null) {
         request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,identity.getName(),identity.getPassword()));
      }
      if (cookie!=null) {
         request.getCookies().add(cookie);
      }
      request.setEntity(new StringRepresentation(xml,MediaType.APPLICATION_ATOM_XML));
View Full Code Here

   public Status deleteEntry(UUID entryId)
   {
      URI entryLocation = getEntryLocation(entryId);
      Request request = new Request(Method.DELETE,entryLocation.toString());
      if (identity!=null) {
         request.setChallengeResponse(new ChallengeResponse(ChallengeScheme.HTTP_BASIC,identity.getName(),identity.getPassword()));
      }
      if (cookie!=null) {
         request.getCookies().add(cookie);
      }
      Response response = locClient.handle(request);
View Full Code Here

TOP

Related Classes of org.restlet.data.ChallengeResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.