Package com.ibm.sbt.services.client.ClientService

Examples of com.ibm.sbt.services.client.ClientService.ContentStream


           
            InputStream is = null;
       
          try {
        is = new FileInputStream(serverFile);
        ContentStream contentFile = new ContentStream(is,serverFile.length(), name);
        SmartCloudService svc = new SmartCloudService(authBean);

        svc.post(SERVICE_URL, params, contentFile);
        
          } catch (ClientServicesException e) {
View Full Code Here


        }
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.UPLOAD_NEW_VERSION_COMMUNITY_FILE.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId),
                FileUrlParts.fileId.get(fileId));
        ContentStream contentFile = (ContentStream) getContentObject(title, iStream);
        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.
        return uploadNewVersion(requestUri, contentFile, params, headers);
    }
View Full Code Here

     * @return Content
     */
    private Content getContentObject(String title, InputStream stream, long length) {
        Content contentFile;
        if (StringUtil.isNotEmpty(getMimeType(title))) {
            contentFile = new ContentStream(title, stream, length, getMimeType(title));
        } else {
            contentFile = new ContentStream(stream, length, title);
        }
        return contentFile;
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.ClientService.ContentStream

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.