Skip to content

Commit

Permalink
more lib updates and cloud sync fixes
Browse files Browse the repository at this point in the history
* added a fallback if something went wrong with cloud sync init
* removed old libs
  • Loading branch information
Seil0 committed Oct 29, 2017
1 parent 5b46a0b commit eb12728
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 20 deletions.
24 changes: 12 additions & 12 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
<classpathentry kind="lib" path="src/libraries/minimal-json-0.9.4.jar"/>
<classpathentry kind="lib" path="src/libraries/commons-logging-api-1.1.jar"/>
<classpathentry kind="lib" path="src/libraries/commons-vfs2-2.1.1744488.2.jar"/>
<classpathentry kind="lib" path="src/libraries/flow-8.0.1.jar"/>
<classpathentry kind="lib" path="src/libraries/zip4j-1.3.2.jar"/>
Expand All @@ -14,16 +13,17 @@
<classpathentry kind="lib" path="src/libraries/jfoenix-1.9.1.jar"/>
<classpathentry kind="lib" path="src/libraries/commons-codec-1.11.jar"/>
<classpathentry kind="lib" path="src/libraries/commons-io-2.6.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-api-client-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-api-services-drive-v3-rev87-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-http-client-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-http-client-jackson2-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-oauth-client-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-oauth-client-java6-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/google-oauth-client-jetty-1.23.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/jackson-core-2.9.2.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/javax.servlet-api-4.0.0.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/jetty-6.1.26.jar"/>
<classpathentry kind="lib" path="/home/jannik/eclipse-workspace/cemu_UI/src/libraries/google_api_libraries/jetty-util-6.1.26.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-api-client-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-api-services-drive-v3-rev87-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-http-client-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-http-client-jackson2-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-oauth-client-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-oauth-client-java6-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/google-oauth-client-jetty-1.23.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/jackson-core-2.9.2.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/javax.servlet-api-4.0.0.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/jetty-6.1.26.jar"/>
<classpathentry kind="lib" path="src/libraries/google_api_libraries/jetty-util-6.1.26.jar"/>
<classpathentry kind="lib" path="src/libraries/commons-logging-1.1.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
4 changes: 4 additions & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/cloudControllerInstances/
/libraries/
/resources/
/application/
Binary file modified bin/application/CloudController$1.class
Binary file not shown.
Binary file modified bin/application/CloudController$2.class
Binary file not shown.
Binary file modified bin/application/CloudController$3.class
Binary file not shown.
Binary file modified bin/application/CloudController.class
Binary file not shown.
Binary file modified bin/application/Main.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$10.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$11.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$12.class
Binary file not shown.
Binary file modified bin/application/MainWindowController.class
Binary file not shown.
Binary file modified bin/cloudControllerInstances/GoogleDriveController.class
Binary file not shown.
Binary file removed bin/libraries/commons-logging-api-1.1.jar
Binary file not shown.
8 changes: 7 additions & 1 deletion src/application/CloudController.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,26 @@ public CloudController(Main ma) {
private GoogleDriveController googleDriveController = new GoogleDriveController();
private static final Logger LOGGER = LogManager.getLogger(CloudController.class.getName());

void initializeConnection(String cloudService, String cemuDirectory) {
boolean initializeConnection(String cloudService, String cemuDirectory) {
boolean success = false;
LOGGER.info("sartting cloud initialisation ...");

if(cloudService.equals("GoogleDrive")) {
LOGGER.info("selected service is Google Drive");
try {
googleDriveController.main(cemuDirectory);
} catch (IOException e) {
LOGGER.error("error while initialize connection", e);
return success;
}
success = true;
}

if(cloudService.equals("Dropbox")) {
LOGGER.info("selected service is Dropbox");
}
LOGGER.info("cloud initialisation done!");
return success;
}

void stratupCheck(String cloudService, String cemuDirectory) {
Expand Down
12 changes: 9 additions & 3 deletions src/application/MainWindowController.java
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,15 @@ public void handle(ActionEvent event){
cloudSync = true;
//TODO rework for other cloud services
cloudService = "GoogleDrive";
main.cloudController.initializeConnection(getCloudService(), getCemuPath());
main.cloudController.sync(getCloudService(), getCemuPath());
saveSettings();
if (main.cloudController.initializeConnection(getCloudService(), getCemuPath())) {
main.cloudController.sync(getCloudService(), getCemuPath());
saveSettings();
} else {
cloudSyncToggleBtn.setSelected(false);
// TODO show error message
}

// saveSettings();
dialog.close();
}
});
Expand Down
7 changes: 3 additions & 4 deletions src/cloudControllerInstances/GoogleDriveController.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ public Credential authorize() throws IOException {
InputStream in = getClass().getClassLoader().getResourceAsStream("resources/client_secret.json");
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));

//FIXME Linux fails to open a new browser window, application crashes
//FIXME Linux fails to open a new browser window, application crashes, maybe a kde only bug
// Build flow and trigger user authorization request.
GoogleAuthorizationCodeFlow flow =
new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)
.setDataStoreFactory(DATA_STORE_FACTORY)
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)
.setDataStoreFactory(DATA_STORE_FACTORY)
.setAccessType("offline")
.build();
Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
Expand Down
Binary file added src/libraries/commons-logging-1.1.1.jar
Binary file not shown.
Binary file removed src/libraries/commons-logging-api-1.1.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/libraries/google_apis_old/jetty-6.1.25.jar
Binary file not shown.
Binary file removed src/libraries/google_apis_old/jetty-util-6.1.25.jar
Binary file not shown.

0 comments on commit eb12728

Please sign in to comment.