Exemplo n.º 1
0
  public static DocumentListEntry executePost(
      HttpRequestFactory requestFactory, DocsUrl url, AtomContent content) throws IOException {

    HttpRequest request = requestFactory.buildPostRequest(url, content);
    HttpResponse response = requestExecutor.executeSensitive(request);
    return response.parseAs(DocumentListEntry.class);
  }
Exemplo n.º 2
0
  public static Entry executeGet(
      HttpRequestFactory requestFactory, DocsUrl url, Class<Entry> feedClass) throws IOException {

    HttpRequest request = requestFactory.buildGetRequest(url);
    HttpResponse response = requestExecutor.executeNonSensitive(request);
    return response.parseAs(feedClass);
  }
Exemplo n.º 3
0
  public static InputStream executeGetContent(HttpRequestFactory requestFactory, DocsUrl url)
      throws IOException {

    HttpRequest request = requestFactory.buildGetRequest(url);
    HttpResponse response = requestExecutor.executeNonSensitive(request);
    return response.getContent();
  }
Exemplo n.º 4
0
 public static void executeDelete(
     HttpRequestFactory requestFactory, DocsUrl url, String etag, boolean matchAll)
     throws IOException {
   HttpRequest request = requestFactory.buildDeleteRequest(url);
   if (matchAll) request.getHeaders().setIfMatch("*");
   else request.getHeaders().setIfMatch(etag);
   HttpResponse response = requestExecutor.executeNonSensitive(request);
   response.ignore();
 }
Exemplo n.º 5
0
 public static Feed first100Entries(HttpRequestFactory requestFactory, DocsUrl url)
     throws IOException {
   HttpRequest request = requestFactory.buildGetRequest(url);
   HttpResponse response = requestExecutor.executeNonSensitive(request);
   return response.parseAs(Feed.class);
 }