Package org.apache.abdera.protocol

Examples of org.apache.abdera.protocol.Response


     */
    private static Scriptable post(Context cx, Object[] arguments, APPClientHostObject hostObject,
                                   Entry entry) throws CarbonException {

        performAuthentication(hostObject, (String) arguments[0]);
        Response response = hostObject.client.post((String) arguments[0],
                                                   new BaseRequestEntity(entry, false),
                                                   hostObject.options);

        // Check the response.
        if (response.getStatus() != 201) {
            throw new CarbonException("Posting Failed." + response.getStatusText());
        }

        Scriptable entryHostObject = cx.newObject(hostObject, "AtomEntry", new Object[0]);
        ((AtomEntryHostObject) entryHostObject).setEntry(entry);

View Full Code Here


   
    RequestOptions options = abderaClient.getDefaultRequestOptions();
    options.setUseChunked(false);
   
    // Post the entry
    Response response = abderaClient.post(
      "http://beta.blogger.com/feeds/7352231422284704069/posts/full",
      entry, options);
   
    // Check the response.
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
   
  }
View Full Code Here

    Service service = service_doc.getRoot();
    Collection collection = service.getWorkspaces().get(0).getCollections().get(0);
    String uri = collection.getHref().toString();
     
    // Post the entry to the collection
    Response response = abderaClient.post(uri, entry);
   
    // Check the result
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
  }
View Full Code Here

    // current Roller APP implementation still currently requires it.
    RequestOptions options = abderaClient.getDefaultRequestOptions();
    options.setHeader("Title", "mypodcast.mp3");
   
    // Post the entry
    Response response = abderaClient.post(uri, re, options);
   
    // Check the response
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
 
View Full Code Here

   
    RequestOptions options = abderaClient.getDefaultRequestOptions();
    options.setUseChunked(false);
   
    // Post the entry
    Response response = abderaClient.post(uri, entry, options);
   
    // Google Calendar might return a 302 response with a new POST URI.
    // If it does, get the new URI and post again
    if (response.getStatus() == 302) {
      uri = response.getLocation().toString();
      response = abderaClient.post(uri, entry, options);
    }
   
    // Check the response
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
   
  }
View Full Code Here

   
    RequestOptions options = client.getDefaultRequestOptions();
    options.setUseChunked(false);
   
    // Post the entry
    Response response = client.post(
      "http://beta.blogger.com/feeds/7352231422284704069/posts/full",
      entry, options);
   
    // Check the response.
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
   
  }
View Full Code Here

    Service service = service_doc.getRoot();
    Collection collection = service.getWorkspaces().get(0).getCollections().get(0);
    String uri = collection.getHref().toString();
     
    // Post the entry to the collection
    Response response = client.post(uri, entry);
   
    // Check the result
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
  }
View Full Code Here

    // current Roller APP implementation still currently requires it.
    RequestOptions options = client.getDefaultRequestOptions();
    options.setHeader("Title", "mypodcast.mp3");
   
    // Post the entry
    Response response = client.post(uri, re, options);
   
    // Check the response
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
 
View Full Code Here

   
    RequestOptions options = client.getDefaultRequestOptions();
    options.setUseChunked(false);
   
    // Post the entry
    Response response = client.post(uri, entry, options);
   
    // Google Calendar might return a 302 response with a new POST URI.
    // If it does, get the new URI and post again
    if (response.getStatus() == 302) {
      uri = response.getLocation().toString();
      response = client.post(uri, entry, options);
    }
   
    // Check the response
    if (response.getStatus() == 201)
      System.out.println("Success!");
    else
      System.out.println("Failed!");
   
  }
View Full Code Here

        RequestOptions options = abderaClient.getDefaultRequestOptions();
        options.setUseChunked(false);

        // Post the entry
        Response response =
            abderaClient.post("http://beta.blogger.com/feeds/7352231422284704069/posts/full", entry, options);

        // Check the response.
        if (response.getStatus() == 201)
            System.out.println("Success!");
        else
            System.out.println("Failed!");

    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.Response

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.