Package com.google.api.client.http

Examples of com.google.api.client.http.AbstractInputStreamContent


    } else {
      // Use the chunkSize as the blockSize because we do know what what it is yet.
      blockSize = chunkSize;
    }

    AbstractInputStreamContent contentChunk;
    int actualBlockSize = blockSize;
    if (isMediaLengthKnown()) {
      // Mark the current position in case we need to retry the request.
      contentInputStream.mark(blockSize);
View Full Code Here


            // Upload new apk to developer console
            final String apkPath = BasicUploadApk.class
                    .getResource(ApplicationConfig.APK_FILE_PATH)
                    .toURI().getPath();
            final AbstractInputStreamContent apkFile =
                    new FileContent(AndroidPublisherHelper.MIME_TYPE_APK, new File(apkPath));
            Upload uploadRequest = edits
                    .apks()
                    .upload(ApplicationConfig.PACKAGE_NAME,
                            editId,
View Full Code Here

            // Upload new apk to developer console
            final String apkPath = UploadApkWithListing.class
                    .getResource(ApplicationConfig.APK_FILE_PATH)
                    .toURI().getPath();
            final AbstractInputStreamContent apkFile =
                    new FileContent(AndroidPublisherHelper.MIME_TYPE_APK, new File(apkPath));
            Upload uploadRequest = edits
                    .apks()
                    .upload(ApplicationConfig.PACKAGE_NAME,
                            editId,
View Full Code Here

      AppEdit edit = editRequest.execute();
      final String editId = edit.getId();
      getLogger().info(String.format("Created edit with id: %s", editId));

      // Upload new apk to developer console
      final AbstractInputStreamContent apkFileContent =
          new FileContent(AndroidPublisherHelper.MIME_TYPE_APK,
              getReleaseApkFile(publisherExtension));
      Upload uploadRequest = edits
          .apks()
          .upload(publisherExtension.getPackageName(),
View Full Code Here

            AppEdit edit = editRequest.execute();
            final String editId = edit.getId();
            log.info(String.format("Created edit with id: %s", editId));

            // Upload new apk to developer console
            final AbstractInputStreamContent apkFile =
                    new FileContent(AndroidPublisherHelper.MIME_TYPE_APK, apkFiles);
            Upload uploadRequest = edits
                    .apks()
                    .upload(packageName,
                            editId,
View Full Code Here

        .title(title)
        .mimeType(mimeType)
        .parent(id)
        .build();

    AbstractInputStreamContent mediaContent;
    mediaContent = mimeType.mediaContentOf(from);

    return drive
        .files()
        .insert(body, mediaContent)
View Full Code Here

    reportFile.setParents(Arrays.asList(new ParentReference().setId(outputFolder.getId())));

    // Write the PDF file to Drive.
    if (reportFileType.equals(ReportFileType.PDF)) {
      reportFile.setMimeType(PDF_MIME_TYPE);
      AbstractInputStreamContent aisc = new InputStreamContent(PDF_MIME_TYPE, inputStream);
      googleDriveService.getDriveService().files().insert(reportFile, aisc).execute();
    }

    // Write the HTML file to Drive.
    if (reportFileType.equals(ReportFileType.HTML)) {
      reportFile.setMimeType(HTML_MIME_TYPE);
      AbstractInputStreamContent aisc = new InputStreamContent(HTML_MIME_TYPE, inputStream);
      googleDriveService.getDriveService().files().insert(reportFile, aisc).execute();
    }
   
    // Convert the HTML file to a Drive Doc and write to Drive.
    if (reportFileType.equals(ReportFileType.DRIVE_DOC)) {
      reportFile.setMimeType(DOC_MIME_TYPE);
      AbstractInputStreamContent aisc = new InputStreamContent(HTML_MIME_TYPE, inputStream);
      googleDriveService.getDriveService().files().insert(reportFile, aisc).setConvert(true).execute();
    }
    inputStream.close();
  }
View Full Code Here

TOP

Related Classes of com.google.api.client.http.AbstractInputStreamContent

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.