From c29380f510b4b680fdd7ec4c140bffe8fb30be76 Mon Sep 17 00:00:00 2001 From: Brian Patino Date: Sat, 20 Feb 2016 22:38:01 -0500 Subject: [PATCH] Add Dropbox API set up * gitignore dropbox credentials * add base Dropbox class * add empty files for directory structure --- .gitignore | 5 ++++- README.md | 40 ++++++++++++++++++++--------------- src/main/webapp/Dropbox.java | 28 ++++++++++++++++++++++++ src/main/webapp/dropbox.json | 5 +++++ src/test/main/Test.java | 8 +++++++ src/test/resources/blank.text | 1 + 6 files changed, 69 insertions(+), 18 deletions(-) create mode 100644 src/main/webapp/Dropbox.java create mode 100644 src/main/webapp/dropbox.json create mode 100644 src/test/main/Test.java create mode 100644 src/test/resources/blank.text diff --git a/.gitignore b/.gitignore index bd64445..43f9955 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ # IntelliJ .idea/ *.iml -out/ \ No newline at end of file +out/ + +# nope not having it +/src/main/webapp/dropbox.json diff --git a/README.md b/README.md index 93c2e42..6623eb8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Iron Gate +[![build-passing](https://img.shields.io/badge/build-passing-brightgreen.svg)]() +[![version](https://img.shields.io/badge/version-0.2-red.svg)]() -Iron Gate is the code name given to a really convenient files and folders organization system. This is a cross-platform application built for Windows and Mac OSX. Some really great features: +Iron Gate is the code name given to a really convenient files and folders organization system. This is a cross-platform application built for Windows and Mac OSX. A few things Iron Gate can do: - Tag files and folders for quick search up - Save folder structures frequently used @@ -8,30 +10,30 @@ Iron Gate is the code name given to a really convenient files and folders organi - Search, upload, and download other user directory templates - Easily remove unused files and folders - ... more to come - - -### Version -0.2 - -### Tech - -The following is used to develop Iron Gate: -* [JavaFX] - great GUI library -* [JavaFX Scene Builder] - faster way to build! +### Cloud Support -Iron Gate is open source, feel free to [contribute]! +Iron Gate supports the following cloud services +- Dropbox +- Google Drive +- OneDrive ### Installation Any java based IDE can build Iron Gate, although [IntelliJ] is highly recommended. -### Plugins +### Libraries and Other Technology + +The following is used to develop Iron Gate: -Iron Gate will eventually use the following plugins: -* Dropbox -* Google Drive -* OneDrive +- [JavaFX] - great GUI library +- [JavaFX Scene Builder] - faster way to build! +- [JUnit] - a simple framework to write repeatable tests +- [Dropbox SDK] - a Java library to access Dropbox's HTTP-based Core API v2 +- [Google Drive API] - integration with google drive +- [OneDrive API] - integration with one drive + +Iron Gate is open source, feel free to [contribute]! ### Todos - ~~file browser controller~~ @@ -46,3 +48,7 @@ Iron Gate will eventually use the following plugins: [JavaFX Scene Builder]: [IntelliJ]: [contribute]: + [Dropbox SDK]: https://github.com/dropbox/dropbox-sdk-java + [JUnit]: http://junit.org/ + [Google Drive API]: https://developers.google.com/drive/v3/web/enable-sdk + [OneDrive API]: https://dev.onedrive.com/ diff --git a/src/main/webapp/Dropbox.java b/src/main/webapp/Dropbox.java new file mode 100644 index 0000000..5556089 --- /dev/null +++ b/src/main/webapp/Dropbox.java @@ -0,0 +1,28 @@ +package main.webapp; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.FileNotFoundException; +import java.io.FileReader; + +/** + * Dropbox API specific + */ +public class Dropbox { + // retrieve private credentials from Dropbox Developers app + static { + try { + FileReader readCred = new FileReader("dropbox.json"); + JSONObject dropCred = new JSONObject(readCred); + final String key = dropCred.getString("key"); + final String secret = dropCred.getString("secret"); + final String token = dropCred.getString("token"); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + +} diff --git a/src/main/webapp/dropbox.json b/src/main/webapp/dropbox.json new file mode 100644 index 0000000..44826fd --- /dev/null +++ b/src/main/webapp/dropbox.json @@ -0,0 +1,5 @@ +{ + "key": "oz86s28acxaqre2", + "secret": "j9u4yh94ke45as8", + "token": "pxuSD7bJpSgAAAAAAAGupZnsWNjAJScyxlBm2fvBf3ir2fndkp-DT67xJIlBuArg" +} \ No newline at end of file diff --git a/src/test/main/Test.java b/src/test/main/Test.java new file mode 100644 index 0000000..6c6eebb --- /dev/null +++ b/src/test/main/Test.java @@ -0,0 +1,8 @@ +package test.main; + +/** + * A test of test methods + */ +public class Test { + +} diff --git a/src/test/resources/blank.text b/src/test/resources/blank.text new file mode 100644 index 0000000..cb843b9 --- /dev/null +++ b/src/test/resources/blank.text @@ -0,0 +1 @@ +resources test goes here \ No newline at end of file