Package com.google.api.services.drive.Drive.Files

Examples of com.google.api.services.drive.Drive.Files.Insert


        if (data == null) {
          driveItem = service.files().insert(driveItem).execute();
        } else {
          final InputStreamContent params = new InputStreamContent(FILE, new ByteArrayInputStream(data));
          params.setLength(data.length);
          Insert inserter = service.files().insert(driveItem, params);
          MediaHttpUploader uploader = inserter.getMediaHttpUploader();
          prepareUploader(uploader, data);
          driveItem = inserter.execute();
        }
        if (driveItem == null) {
          throw new CloudsyncException("Could not create item '" + item.getPath() + "'");
        }
        _addToCache(driveItem, null);
View Full Code Here


    out.close();
    documentIS.close();

    FileContent mediaContent = new FileContent(mimeType, fileContent);

    Insert insert = driveService.files().insert(body, mediaContent);
    insert.getMediaHttpUploader().setDirectUploadEnabled(true);
    File file = insert.setConvert(true).execute();

    return file;
  }
View Full Code Here

TOP

Related Classes of com.google.api.services.drive.Drive.Files.Insert

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.