Пример #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);
  }
Пример #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);
  }
Пример #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();
  }
Пример #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();
 }
Пример #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);
 }