第60章 GoogleDrive


GoogleDrive Component

Camel 2.14 から利用可能
Google ドライブは、OAuth 2.0 プロトコル を使用して Google アカウントを認証し、ユーザーデータへのアクセスを承認します。このコンポーネントを使用する前に、アカウントを作成し、OAuth クレデンシャル を生成 する必要があります。認証情報は、clientId、clientSecret、および refreshToken で設定されます。有効期間の長い refreshToken を生成するための便利なリソースは OAuth プレイグラウンドです
Maven ユーザーは、このコンポーネントの pom.xml に以下の依存関係を追加する必要があります。
<dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-google-drive</artifactId>
        <version>2.14-SNAPSHOT</version>
</dependency>
Copy to Clipboard Toggle word wrap

URI 形式

GoogleDrive コンポーネントは以下の URI 形式を使用します。
google-drive://endpoint-prefix/endpoint?[options]
Copy to Clipboard Toggle word wrap
エンドポイント接頭辞は以下のいずれかになります。
  • drive-about
  • drive-apps
  • drive-changes
  • drive-channels
  • drive-children
  • drive-comments
  • drive-files
  • drive-parents
  • drive-permissions
  • drive-properties
  • drive-realtime
  • drive-replies
  • drive-revisions

GoogleDriveComponent

GoogleDrive コンポーネントは、以下のオプションで設定できます。これらのオプションは、タイプ org.apache.camel.component.google.drive.GoogleDriveConfiguration のコンポーネントの Bean プロパティー configuration を使用して提供できます。
Expand
オプション タイプ 説明
accessToken String OAuth 2 アクセストークン通常、これは 1 時間後に期限切れになるため、長期間の使用には refreshToken が推奨されます。
applicationName String Google ドライブアプリケーション名。たとえば、camel-google-drive/1.0 です。
clientId String ドライブアプリケーションのクライアント ID
clientSecret String ドライブアプリケーションのクライアントシークレット
refreshToken
String
OAuth 2 トークンの更新これを使用すると、現在の有効期限が切れるたびに Google ドライブコンポーネントが新しい accessToken を取得することができます。アプリケーションが長い期間であれば必要です。
scopes List<String> ドライブアプリケーションでユーザーアカウントに必要なパーミッションのレベルを指定します。詳細は、https://developers.google.com/drive/web/scopes を参照してください。

プロデューサーエンドポイント

プロデューサーエンドポイントはエンドポイント接頭辞を使用し、続いてエンドポイント名と以下で説明する関連オプションを使用できます。一部のエンドポイントには、短縮エイリアスを使用できます。エンドポイント URI には 接頭辞が含まれている必要があります。
必須ではないエンドポイントオプションは [] で示されます。エンドポイントに必須のオプションがない場合は、[] オプションのセットの 1 つを指定する必要があります。プロデューサーエンドポイントは、Camel Exchange In メッセージに含まれる値を持つ endpoint オプションの名前が含まれる必要がある特別なオプション inBody を使用することもできます。
エンドポイントオプションは、エンドポイント URI またはメッセージヘッダーで動的に指定できます。メッセージヘッダー名は CamelGoogleDrive.<option> の形式である必要があります。inBody オプションはメッセージヘッダーを上書きすることに注意してください。つまり、エンドポイントオプション inBody=optionCamelGoogleDrive.option ヘッダーを上書きすることに注意してください。
エンドポイントおよびオプションの詳細は、API ドキュメント( https://developers.google.com/drive/v2/reference/)を参照してください。

1.エンドポイント接頭辞 drive-about

以下のエンドポイントは、以下のように接頭辞 drive-about で呼び出すことができます。
google-drive://drive-about/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
get com.google.api.services.drive.model.About

drive-about の URI オプション

Expand
名前 タイプ

2.エンドポイント接頭辞 drive-apps

以下のエンドポイントは、以下のように接頭辞 drive-apps で呼び出すことができます。
google-drive://drive-apps/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
get appId com.google.api.services.drive.model.App
list com.google.api.services.drive.model.AppList

drive-apps の URI オプション

Expand
名前 タイプ
appId String

3.エンドポイント接頭辞 drive-changes

以下のエンドポイントは、以下のように接頭辞 drive-changes で呼び出すことができます。
        google-drive://drive-changes/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
get changeId com.google.api.services.drive.model.Change
list com.google.api.services.drive.model.ChangeList
watch contentChannel com.google.api.services.drive.model.Channel

drive-changes の URI オプション

Expand
名前 タイプ
changeId String
contentChannel com.google.api.services.drive.model.Channel

4.エンドポイント接頭辞ドライブチャネル

以下のエンドポイントは、以下のように接頭辞 drive-channels で呼び出すことができます。
google-drive://drive-channels/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
stop contentChannel

drive-channel の URI オプション

Expand
名前 タイプ
contentChannel com.google.api.services.drive.model.Channel

5.エンドポイント接頭辞 drive-children

以下のエンドポイントは、以下のように接頭辞 drive-children で呼び出すことができます。
google-drive://drive-children/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete childId, folderId
get childId, folderId com.google.api.services.drive.model.ChildReference
insert content, folderId com.google.api.services.drive.model.ChildReference
list folderId com.google.api.services.drive.model.ChildList

drive-children の URI オプション

Expand
名前 タイプ
childId String
content com.google.api.services.drive.model.ChildReference
folderId String

6.エンドポイント接頭辞ドライブ

以下のエンドポイントは、以下のように接頭辞 drive-comments で呼び出すことができます。
google-drive://drive-comments/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete commentId, fileId
get commentId, fileId com.google.api.services.drive.model.Comment
insert content, fileId com.google.api.services.drive.model.Comment
list fileId com.google.api.services.drive.model.CommentList
patch commentId, content, fileId com.google.api.services.drive.model.Comment
update commentId, content, fileId com.google.api.services.drive.model.Comment

drive-comment の URI オプション

Expand
名前 タイプ
commentId String
content com.google.api.services.drive.model.Comment
fileId String

7.エンドポイント接頭辞ドライブファイル

以下のエンドポイントは、以下のように接頭辞 drive-files で呼び出すことができます。
google-drive://drive-files/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
copy content, fileId com.google.api.services.drive.model.File
delete fileId
emptyTrash
get fileId com.google.api.services.drive.model.File
insert [mediaContent], content com.google.api.services.drive.model.File
list com.google.api.services.drive.model.FileList
patch content, fileId com.google.api.services.drive.model.File
touch fileId com.google.api.services.drive.model.File
trash fileId com.google.api.services.drive.model.File
untrash fileId com.google.api.services.drive.model.File
update [mediaContent], content, fileId com.google.api.services.drive.model.File
watch contentChannel, fileId com.google.api.services.drive.model.Channel

drive-files の URI オプション

Expand
名前 タイプ
content com.google.api.services.drive.model.File
contentChannel com.google.api.services.drive.model.Channel
fileId String
mediaContent com.google.api.client.http.AbstractInputStreamContent

8.エンドポイント接頭辞 drive-parents

以下のエンドポイントは、以下のように接頭辞 drive-parents で呼び出すことができます。
google-drive://drive-parents/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete fileId, parentId
get fileId, parentId com.google.api.services.drive.model.ParentReference
insert content, fileId com.google.api.services.drive.model.ParentReference
list fileId com.google.api.services.drive.model.ParentList

drive-parents の URI オプション

Expand
名前 タイプ
content com.google.api.services.drive.model.ParentReference
fileId String
parentId String

9.エンドポイント接頭辞 drive-permissions

以下のエンドポイントは、以下のように接頭辞 drive-permissions で呼び出すことができます。
google-drive://drive-permissions/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete fileId, permissionId
get fileId, permissionId com.google.api.services.drive.model.Permission
getIdForEmail email com.google.api.services.drive.model.PermissionId
insert content, fileId com.google.api.services.drive.model.Permission
list fileId com.google.api.services.drive.model.PermissionList
patch content, fileId, permissionId com.google.api.services.drive.model.Permission
update content, fileId, permissionId com.google.api.services.drive.model.Permission

drive-permissions の URI オプション

Expand
名前 タイプ
content com.google.api.services.drive.model.Permission
email String
fileId String
permissionId String

10.エンドポイント接頭辞 drive-properties

以下のエンドポイントは、以下のように接頭辞 drive-properties で呼び出すことができます。
google-drive://drive-properties/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete fileId, propertyKey
get fileId, propertyKey com.google.api.services.drive.model.Property
insert content, fileId com.google.api.services.drive.model.Property
list fileId com.google.api.services.drive.model.PropertyList
patch content, fileId, propertyKey com.google.api.services.drive.model.Property
update content, fileId, propertyKey com.google.api.services.drive.model.Property

drive-properties の URI オプション

Expand
名前 タイプ
content com.google.api.services.drive.model.Property
fileId String
propertyKey String

11.エンドポイント接頭辞 drive-realtime

以下のエンドポイントは、以下のように接頭辞 drive-realtime で呼び出すことができます。
google-drive://drive-realtime/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
get fileId
update [mediaContent], fileId

drive-realtime の URI オプション

Expand
名前 タイプ
fileId String
mediaContent com.google.api.client.http.AbstractInputStreamContent

12.エンドポイント接頭辞ドライブ

以下のエンドポイントは、以下のように接頭辞 drive-replies で呼び出すことができます。
google-drive://drive-replies/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete commentId, fileId, replyId
get commentId, fileId, replyId com.google.api.services.drive.model.CommentReply
insert commentId, content, fileId com.google.api.services.drive.model.CommentReply
list commentId, fileId com.google.api.services.drive.model.CommentReplyList
patch commentId, content, fileId, replyId com.google.api.services.drive.model.CommentReply
update commentId, content, fileId, replyId com.google.api.services.drive.model.CommentReply

drive-replies の URI オプション

Expand
名前 タイプ
commentId String
content com.google.api.services.drive.model.CommentReply
fileId String
replyId String

13.エンドポイント接頭辞 drive-revisions

以下のエンドポイントは、以下のように接頭辞 drive-revisions で呼び出すことができます。
google-drive://drive-revisions/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント 短縮形エイリアス オプション 結果ボディーのタイプ
delete fileId, revisionId
get fileId, revisionId com.google.api.services.drive.model.Revision
list fileId com.google.api.services.drive.model.RevisionList
patch content, fileId, revisionId com.google.api.services.drive.model.Revision
update content, fileId, revisionId com.google.api.services.drive.model.Revision

drive-revisions の URI オプション

Expand
名前 タイプ
content com.google.api.services.drive.model.Revision
fileId String
revisionId String

コンシューマーエンドポイント

プロデューサーエンドポイントはいずれもコンシューマーエンドポイントとして使用できます。コンシューマーエンドポイントは、consumer. 接頭辞が付い た Scheduled Poll Consumer オプション を使用して、エンドポイントの呼び出しをスケジュールできます。配列またはコレクションを返すコンシューマーエンドポイントは、要素ごとにエクスチェンジを 1 つ生成し、それらのルートはエクスチェンジごとに 1 回実行されます。

メッセージヘッダー

URI オプションは、CamelGoogleDrive. 接頭辞が付いたプロデューサーエンドポイントのメッセージヘッダーで指定できます。

メッセージボディー

すべての結果メッセージ本文は、GoogleDriveComponent が使用する基礎となる API によって提供されるオブジェクトを使用します。プロデューサーエンドポイントは、inBody エンドポイント URI パラメーターに受信メッセージボディーのオプション名を指定できます。配列またはコレクションを返すエンドポイントの場合、コンシューマーエンドポイントはすべての要素を個別のメッセージにマップします。
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat