Home

Awesome

Camel Google Drive Component

The Google Drive component supports storing objetcs to Google Drive service.

URI Format

gdrive://mydrive[?options]

You can append query options to the URI in the following format, ?options=value&option2=value&...

URI Options

NameDefault ValueContextDescription
gDriveClientnullSharedReference to a com.google.api.services.drive.Drive in the Registry.
accessTokennullSharedGoogle Drive access token
refreshTokennullSharedGoogle Drive refresh token
clientIdnullSharedApplication id to connect to Google Drive
clientSecretnullSharedApplication secret key to connect to Google Drive
deleteAfterReadtrueSharedDelete files from google drive after read

Authentication

This component use Offline OAuth 2.0 for Web Server Applications, you should follow the following instructions to get an authentication code: https://developers.google.com/accounts/docs/OAuth2WebServer. The component doesn't provide the authentication process, it assumes that the token given is valid.

In case a clientId and clientSecret were configured, a refresh token request is made by the component. Enabling a expired token request still alive and sucess without throwing an unauthorized exception.

How to use with DSL

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
		public void configure() {
            from("file://local/path")
              .process(MyProcessor())
              .to("gdrive://mydrive");
        }
    };
}

How to use with XML

<route>
  <from uri="file://local/path" />
  <process ref="myProcessor" />
  <to uri="gdrive://mydrive" />
</route>

Message Headers

HeaderDescription
CamelGDriveContentTypeContent type of the file
CamelGDriveDescriptionDescription for the file that will appear in Google Drive
CamelGDriveTitleTitle of the file in Google Drive (the name)
CamelGDriveETagETag for file
CamelGDriveFileIdFile identifier given by Google Drive
CamelGDriveAccessTokenAccess token for Google Drive
CamelGDriveRefreshTokenRefresh token for Google Drive
CamelGDriveMD5Content MD5 checksum
CamelGDriveContentLengthContent length of the file
CamelGDriveLastModifiedFile last modified date

Dependencies

Maven users will need to add the following dependency to their pom.xml.

<dependency>
    <groupId>com.github.jdavisonc</groupId>
    <artifactId>camel-gdrive</artifactId>
    <version>${gdrive-version}</version>
</dependency>

where ${gdriveversion} must be replaced by the actual version (1.0-SNAPSHOT or higher).

Links

Author

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.