-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(drive): upload and download file
- Loading branch information
1 parent
fcf9944
commit 4ccbc16
Showing
13 changed files
with
421 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...google/google-drive/src/main/java/io/camunda/connector/gdrive/CustomProgressListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.connector.gdrive; | ||
|
||
import com.google.api.client.googleapis.media.MediaHttpUploader; | ||
import com.google.api.client.googleapis.media.MediaHttpUploaderProgressListener; | ||
import java.io.IOException; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class CustomProgressListener implements MediaHttpUploaderProgressListener { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(CustomProgressListener.class); | ||
|
||
@Override | ||
public void progressChanged(MediaHttpUploader uploader) throws IOException { | ||
switch (uploader.getUploadState()) { | ||
case NOT_STARTED: | ||
LOGGER.debug("Upload not started"); | ||
break; | ||
case INITIATION_STARTED: | ||
LOGGER.debug("Initiation has started!"); | ||
break; | ||
case INITIATION_COMPLETE: | ||
LOGGER.debug("Initiation is complete!"); | ||
break; | ||
case MEDIA_IN_PROGRESS: | ||
LOGGER.debug("Upload progress: {}", uploader.getProgress()); | ||
break; | ||
case MEDIA_COMPLETE: | ||
LOGGER.debug("Upload is complete!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.