Anderson
Anderson

Reputation: 33

Google Drive API Java IntelliJ Setup

I am trying to write a simple program that renames video files and uploads them directly to Google Drive using Google Drive API. I have already in the Main class written code to rename my files. My next step is I'd like to upload them to the drive.

My trouble is in integrating the Google Drive API to my existing code. I have followed the quick setup guide here : https://developers.google.com/drive/api/v3/quickstart/java , I have the gradle build and credentials and all, but I have trouble understanding how my classes will interact. My imports have errors, and my project directory looks atrocious. I'm hoping someone can take a look on how this came to be and how can I resolve it.

My Project Directory

Upvotes: 1

Views: 352

Answers (1)

Brockdish
Brockdish

Reputation: 21

I downloaded the project of the plugin DriveBackupV2 to see how other people did this (https://github.com/MaxMaeder/DriveBackupV2) You can do that too so you have the libraries needed:

image

When you added these you have to paste

    <dependency>
                        <groupId>org.bukkit</groupId>
                        <artifactId>bukkit</artifactId>
                        <version>1.9-R0.1-SNAPSHOT</version>
                        <type>jar</type>
                        <scope>provided</scope>
</dependency>
<dependency>
                        <groupId>com.google.apis</groupId>
                        <artifactId>google-api-services-drive</artifactId>
                        <version>v2-rev393-1.25.0</version>
</dependency>

into your pom.xml (yes the indents are wrong) and then all the other needed libraries will be added automatically

Upvotes: 0

Related Questions