Package com.ibm.sbt.services.client

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


   * @throws ClientServicesException
   */
  public void changePriority(int priority) throws ClientServicesException {
    ActivityService activityService = getActivityService();
    if (activityService == null) {
      throw new ClientServicesException(null, "No activity service associated with this activity.");
    }
    activityService.changePriority(this, priority);
  }
View Full Code Here


   * @throws ClientServicesException
   */
  public void uploadFile(String fileName, InputStream fileContent, String mimeType) throws ClientServicesException {
    ActivityService activityService = getActivityService();
    if (activityService == null) {
      throw new ClientServicesException(null, "No activity service associated with this activity.");
    }
    activityService.uploadFile(getActivityUuid(), fileName, fileContent, mimeType);
  }
View Full Code Here

    String topicUuid = (String) fields.get("topicUuid");
    if(StringUtil.isEmpty(getUid())){
      if(StringUtil.isEmpty(topicId) && StringUtil.isNotEmpty(topicUuid)){ // if a topicId was not provided but was set using setTopicUuid method
        topicId = topicUuid;
      }else if(StringUtil.isEmpty(topicId) && StringUtil.isEmpty(topicUuid)){ // Can not create reply without topicUuid
        throw new ClientServicesException(new Exception("No Parent Topic ID mentioned while creating Forum Reply"));
      }
      return getService().createForumReply(topicId, this);
    }else{
      //update scenario
      getService().updateForumReply(this);
View Full Code Here

     * @throws ClientServicesException
     */
    public void flagAsInappropriate(String objectId, String flagReason, ItemType flagWhat)
            throws ClientServicesException {
        if (StringUtil.isEmpty(objectId)) {
            throw new ClientServicesException(null, Messages.Invalid_FileId);
        }
        if (flagWhat == null) {
            throw new ClientServicesException(null, Messages.Invalid_FileId);
        }
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.COLLECTION_ENTRY.format(this, FileUrlParts.accessType.get(accessType));
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(Headers.ContentType, Headers.ATOM);
View Full Code Here

     * @return File
     * @throws ClientServicesException
     */
    public File uploadFile(java.io.File file, Map<String, String> parameters) throws ClientServicesException {
        if (file == null) {
            throw new ClientServicesException(null, Messages.Invalid_FileId);
        }
        if (!file.canRead()) {
            throw new ClientServicesException(null, Messages.MessageCannotReadFile,
                    file.getAbsolutePath());
        }

        try {
            return uploadFile(new FileInputStream(file), file.getName(), file.length(), parameters);
        } catch (FileNotFoundException e) {
            throw new ClientServicesException(null, Messages.MessageCannotReadFile,
                    file.getAbsolutePath());
        }
    }
View Full Code Here

     * @throws ClientServicesException
     */
    public File uploadFile(InputStream stream, final String title, long length,
            Map<String, String> p) throws ClientServicesException {
        if (stream == null) {
            throw new ClientServicesException(null, Messages.Invalid_Stream);
        }
        if (title == null) {
            throw new ClientServicesException(null, Messages.Invalid_Name);
        }
        Content contentFile = getContentObject(title, stream, length);
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.MYUSERLIBRARY_FEED.format(this, FileUrlParts.accessType.get(accessType));
        Map<String, String> headers = new HashMap<String, String>();
View Full Code Here

     * @throws TransformerException
     */
    public EntityList<File> addFilesToFolder(String folderId, List<String> listOfFileIds,
            Map<String, String> params) throws ClientServicesException, TransformerException {
        if (StringUtil.isEmpty(folderId)) {
            throw new ClientServicesException(null, Messages.Invalid_CollectionId);
        }
        for (String fileId : listOfFileIds) {
            if (StringUtil.isEmpty(fileId)) {
                throw new ClientServicesException(null, Messages.Invalid_FileId);
            }
        }
        String accessType = AccessType.AUTHENTICATED.getText();
        params = (null == params) ? new HashMap<String, String>() : params;
        String requestUri = FileUrls.COLLECTION_FEED.format(this, FileUrlParts.accessType.get(accessType),
View Full Code Here

     * @throws TransformerException
     */
    public void shareFileWithCommunities(String fileId, List<String> communityIds, Map<String, String> params)
            throws ClientServicesException, TransformerException {
        if (StringUtil.isEmpty(fileId)) {
            throw new ClientServicesException(null, Messages.Invalid_FileId);
        }
        for (String communityId : communityIds) {
            if (StringUtil.isEmpty(communityId)) {
                throw new ClientServicesException(null, Messages.Invalid_CommunityId);
            }
        }
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_FEED.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId));
View Full Code Here

            if (istream != null) {
                noOfBytes = StreamUtil.copyStream(istream, ostream);
                ostream.flush();
            }
        } catch (IllegalStateException e) {
            throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile);
        } catch (IOException e) {
            throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile);
        }
        return noOfBytes;
    }
View Full Code Here

            if (istream != null) {
                noOfBytes = StreamUtil.copyStream(istream, ostream);
                ostream.flush();
            }
        } catch (IllegalStateException e) {
            throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile);
        } catch (IOException e) {
            throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile);
        }
        return noOfBytes;
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.ClientServicesException

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.