Package com.google.api.services.drive.model

Examples of com.google.api.services.drive.model.ParentReference


    int retryCount = 0;
    do {
      try {
        refreshCredential();
        parentDriveItem = _getDriveItem(item.getParent());
        final ParentReference parentReference = new ParentReference();
        parentReference.setId(parentDriveItem.getId());
        driveItem = new File();
        driveItem.setTitle(title);
        driveItem.setParents(Arrays.asList(parentReference));
        final byte[] data = _prepareDriveItem(driveItem, item, handler, true);
        if (data == null) {
View Full Code Here


          final File _parentDriveItem = _getHistoryFolder(item);
          if (_parentDriveItem != null) {

            final File copyOfdriveItem = new File();
            final ParentReference _parentReference = new ParentReference();
            _parentReference.setId(_parentDriveItem.getId());
            copyOfdriveItem.setParents(Arrays.asList(_parentReference));
            // copyOfdriveItem.setTitle(driveItem.getTitle());
            // copyOfdriveItem.setMimeType(driveItem.getMimeType());
            // copyOfdriveItem.setProperties(driveItem.getProperties());
            final File _copyOfDriveItem = service.files().copy(item.getRemoteIdentifier(), copyOfdriveItem).execute();
View Full Code Here

        refreshCredential();

        final File _parentDriveItem = _getHistoryFolder(item);
        if (_parentDriveItem != null) {

          final ParentReference parentReference = new ParentReference();
          parentReference.setId(_parentDriveItem.getId());
          File driveItem = new File();
          driveItem.setParents(Arrays.asList(parentReference));
          driveItem = service.files().patch(item.getRemoteIdentifier(), driveItem).execute();
          if (driveItem == null) {
            throw new CloudsyncException("Could not make a history snapshot of item '" + item.getPath() + "'");
View Full Code Here

            if (result.size() == 0) {

              final File folder = new File();
              folder.setTitle(name);
              folder.setMimeType(FOLDER);
              final ParentReference parentReference = new ParentReference();
              parentReference.setId(parentItem.getId());
              folder.setParents(Arrays.asList(parentReference));
              _parentItem = service.files().insert(folder).execute();
              if (_parentItem == null) {
                throw new CloudsyncException("Could not create folder '" + name + "'");
              }
View Full Code Here

  @Override
  public GFile write(java.io.File file) {
    File body = new File();
    body.setTitle(file.getName());
    body.setMimeType("text/plain");
    body.setParents(newArrayList(new ParentReference().setId(getId())));

    FileContent mediaContent = new FileContent("text/plain", file);

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

  GDirectory mkdir(String directoryId, String dirName) {
    try {
      File content = new File();
      content.setTitle(dirName);
      content.setMimeType("application/vnd.google-apps.folder");
      content.setParents(newArrayList(new ParentReference().setId(directoryId)));

      File file = service
          .files()
          .insert(content)
          .execute();
View Full Code Here

        + accountId + "for dates between" + dateStart + " and " + dateEnd);

    reportFile.setTitle(reportFileName);

    // Place the file in the correct Drive folder
    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);
View Full Code Here

      LOGGER.info("Creating sub-folder");
      File accountFolder = new File();
      accountFolder.setTitle(accountFolderName);
      accountFolder.setMimeType(FOLDER_MIME_TYPE);
      accountFolder.setDescription("AdWords Reports generated by AwReporting for account# " + accountId);
      accountFolder.setParents(Arrays.asList(new ParentReference().setId(mccDriveDirectory.getId())));

      LOGGER.info("Executing create folder");
      return service.files().insert(accountFolder).execute();
    }
  }
View Full Code Here

TOP

Related Classes of com.google.api.services.drive.model.ParentReference

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.