Skip to content

Commit

Permalink
Add Google Drive extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton committed Mar 18, 2020
1 parent 4a58281 commit ce9ff00
Show file tree
Hide file tree
Showing 14 changed files with 472 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In case you are missing some Camel feature in the list:
== Camel Components

// components: START
Number of Camel components: 78 in 67 JAR artifacts (0 deprecated)
Number of Camel components: 79 in 68 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,5",options="header"]
|===
Expand Down Expand Up @@ -123,6 +123,9 @@ Number of Camel components: 78 in 67 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/ftps-component.html[FTPS] (camel-quarkus-ftp) +
`ftps:host:port/directoryName` | 1.0.0-M1 | The \ftps (FTP secure SSL/TLS) component is used for uploading or downloading files from FTP servers.

| link:https://camel.apache.org/components/latest/google-drive-component.html[Google Drive] (camel-quarkus-google-drive) +
`google-drive:apiName/methodName` | 1.0.0-M6 | The google-drive component provides access to Google Drive file storage service.

| link:https://camel.apache.org/components/latest/google-mail-component.html[Google Mail] (camel-quarkus-google-mail) +
`google-mail:apiName/methodName` | 1.0.0-M6 | The google-mail component provides access to Google Mail.

Expand Down
79 changes: 79 additions & 0 deletions extensions/google-drive/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-drive-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-google-drive-deployment</artifactId>
<name>Camel Quarkus :: Google Drive :: Deployment</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-google-http-client-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-drive</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${quarkus.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* 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.
*/
package org.apache.camel.quarkus.component.google.drive.deployment;

import java.util.Collection;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.AdditionalApplicationArchiveMarkerBuildItem;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.DotName;
import org.jboss.jandex.IndexView;

class GoogleDriveProcessor {

private static final String FEATURE = "camel-google-drive";

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
void applicationArchiveMarkers(BuildProducer<AdditionalApplicationArchiveMarkerBuildItem> applicationArchiveMarker) {
applicationArchiveMarker.produce(new AdditionalApplicationArchiveMarkerBuildItem("com/google/api/services/drive"));
}

@BuildStep
void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<UnbannedReflectiveBuildItem> unbannedClass, CombinedIndexBuildItem combinedIndex) {
IndexView index = combinedIndex.getIndex();

// Google drive component configuration class reflection
Collection<AnnotationInstance> uriParams = index
.getAnnotations(DotName.createSimple("org.apache.camel.spi.UriParams"));

String[] googleDriveConfigClasses = uriParams.stream()
.map(annotation -> annotation.target())
.filter(annotationTarget -> annotationTarget.kind().equals(AnnotationTarget.Kind.CLASS))
.map(annotationTarget -> annotationTarget.asClass().name().toString())
.filter(className -> className.startsWith("org.apache.camel.component.google.drive"))
.toArray(String[]::new);

reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, googleDriveConfigClasses));
unbannedClass.produce(new UnbannedReflectiveBuildItem(googleDriveConfigClasses));
}
}
39 changes: 39 additions & 0 deletions extensions/google-drive/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-build-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../../poms/build-parent/pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-google-drive-parent</artifactId>
<name>Camel Quarkus :: Google Drive</name>
<packaging>pom</packaging>

<modules>
<module>deployment</module>
<module>runtime</module>
</modules>
</project>
87 changes: 87 additions & 0 deletions extensions/google-drive/runtime/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-drive-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-google-drive</artifactId>
<name>Camel Quarkus :: Google Drive :: Runtime</name>
<description>The google-drive component provides access to Google Drive file storage service.</description>

<properties>
<firstVersion>1.0.0-M6</firstVersion>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-google-http-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-google-drive</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${quarkus.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# 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.
#

---
name: "Google Drive"
description: "The google-drive component provides access to Google Drive file storage service."
metadata:
keywords:
- "api"
- "camel"
- "cloud"
- "file"
- "google"
guide: "https://quarkus.io/guides/camel"
categories:
- "integration"
status: "stable"
1 change: 1 addition & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<module>file</module>
<module>file-watch</module>
<module>ftp</module>
<module>google-drive</module>
<module>google-mail</module>
<module>graphql</module>
<module>gson</module>
Expand Down
5 changes: 4 additions & 1 deletion extensions/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Apache Camel Quarkus supports the following Camel artifacts as Quarkus Extension
== Camel Components

// components: START
Number of Camel components: 78 in 67 JAR artifacts (0 deprecated)
Number of Camel components: 79 in 68 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,5",options="header"]
|===
Expand Down Expand Up @@ -110,6 +110,9 @@ Number of Camel components: 78 in 67 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/ftps-component.html[FTPS] (camel-quarkus-ftp) +
`ftps:host:port/directoryName` | 1.0.0-M1 | The \ftps (FTP secure SSL/TLS) component is used for uploading or downloading files from FTP servers.

| link:https://camel.apache.org/components/latest/google-drive-component.html[Google Drive] (camel-quarkus-google-drive) +
`google-drive:apiName/methodName` | 1.0.0-M6 | The google-drive component provides access to Google Drive file storage service.

| link:https://camel.apache.org/components/latest/google-mail-component.html[Google Mail] (camel-quarkus-google-mail) +
`google-mail:apiName/methodName` | 1.0.0-M6 | The google-mail component provides access to Google Mail.

Expand Down
6 changes: 5 additions & 1 deletion integration-tests/google/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@
<!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. -->
<!-- Please update rule whenever you change the dependencies of this module by running -->
<!-- mvn process-resources -Pformat from the root directory -->
<mvnd.builder.rule>camel-quarkus-google-mail-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule>
<mvnd.builder.rule>camel-quarkus-google-drive-deployment,camel-quarkus-google-mail-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-drive</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-mail</artifactId>
Expand Down

0 comments on commit ce9ff00

Please sign in to comment.