Package com.ibm.sbt.services.client

Examples of com.ibm.sbt.services.client.Response


        String payload =  new EntityIdSerializer(communityIds,FileConstants.CATEGORY_COMMUNITY).fileIdListPayload();
       
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(Headers.ContentType, Headers.ATOM);
        headers.put(Headers.ContentLanguage, Headers.UTF);
        Response response = createData(requestUri, params, headers, payload);
        checkResponseCode(response, HTTPCode.NO_CONTENT);
    }
View Full Code Here


        // request headers
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(Headers.ContentType, Headers.BINARY);

        // trigger request to download the file
        Response response = null;
        response = getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM);

        // read the file data
        InputStream istream = (InputStream) response.getData();
        long noOfBytes = 0;
        try {
            if (istream != null) {
                noOfBytes = StreamUtil.copyStream(istream, ostream);
                ostream.flush();
View Full Code Here

                FileUrlParts.category.get(category), FileUrlParts.fileId.get(file.getFileId()),
                FileUrlParts.libraryFilter.get(libraryFilter), FileUrlParts.libraryId.get(libraryId));

        Map<String, String> headers = new HashMap<String, String>();
        headers.put(Headers.ContentType, Headers.BINARY);
        Response response = null;
        response = getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM);
        InputStream istream = (InputStream) response.getData();
        long noOfBytes = 0;
        try {
            if (istream != null) {
                noOfBytes = StreamUtil.copyStream(istream, ostream);
                ostream.flush();
View Full Code Here

     */
    public void deleteFile(String fileId) throws ClientServicesException {
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId));
        Response response = deleteData(requestUri, null, null);
        checkResponseCode(response, HTTPCode.NO_CONTENT);
    }
View Full Code Here

        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.COLLECTION_FEED.format(this, FileUrlParts.accessType.get(accessType),
                FileUrlParts.folderId.get(folderId));
        Map<String, String> params = new HashMap<String, String>();
        params.put(FileRequestParams.ITEMID.getFileRequestParams(), fileId);
        Response response = deleteData(requestUri, params, null);
        checkResponseCode(response, HTTPCode.NO_CONTENT);
    }
View Full Code Here

      throw new ClientServicesException(null,"null forum");
    }
    ForumSerializer serializer = new ForumSerializer(forum);

    String url = ForumUrls.FORUMS.format(this);
    Response response = createData(url, null, getAtomHeaders(), serializer.generateCreate());
    checkResponseCode(response, HTTPCode.CREATED);
    forum = getForumFeedHandler(false).createEntity(response);

    return forum;
  }
View Full Code Here

        Content contentFile = getContentObject(file.getTitle(), inputStream);

        Map<String, String> headers = new HashMap<String, String>();
        headers.put(FileConstants.X_UPDATE_NONCE, getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests.

        Response response = updateData(requestUrl, params, headers, contentFile, null);
        checkResponseCode(response, HTTPCode.OK);
        return getFileFeedHandler().createEntity(response);
    }
View Full Code Here

    }

    ForumSerializer serializer = new ForumSerializer(forum);
    String url = ForumUrls.FORUM.format(this, ForumUrls.forumPart(forum.getForumUuid()));

    Response response = updateData(url, null, serializer.generateUpdate(), null);
    checkResponseCode(response, HTTPCode.OK);
  }
View Full Code Here

   *         forumUuid which is to be deleted
   * @throws ClientServicesException
   */
  public void deleteForum(String forumUuid) throws ClientServicesException {
    String deleteForumUrl = ForumUrls.FORUM.format(this, ForumUrls.forumPart(forumUuid));
    Response response = deleteData(deleteForumUrl, null, null);
    checkResponseCode(response, HTTPCode.NO_CONTENT);
  }
View Full Code Here

            throw new ClientServicesException(null, Messages.Invalid_File);
        }
        String payload = new FileSerializer(file).generateFileUpdatePayload();
        String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(file.getFileId()));
        Response response = updateData(requestUri, params, new ClientService.ContentString(
                payload, CommonConstants.APPLICATION_ATOM_XML), null);
        checkResponseCode(response, HTTPCode.OK);
        return getFileFeedHandler().createEntity(response);
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.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.