forked from fge/java7-fs-dropbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from umjammer/0.0.21
0.0.21
- Loading branch information
Showing
9 changed files
with
291 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright (c) 2016 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package com.github.fge.fs.dropbox; | ||
|
||
import java.net.URI; | ||
import java.nio.file.FileSystem; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import vavi.net.auth.oauth2.OAuth2AppCredential; | ||
import vavi.net.auth.oauth2.dropbox.DropBoxLocalAppCredential; | ||
import vavi.net.fuse.Fuse; | ||
|
||
|
||
/** | ||
* DropBoxFS. (fuse-jna) | ||
* | ||
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer) | ||
* @version 0.00 2016/03/02 umjammer initial version <br> | ||
*/ | ||
public class DropBoxFS { | ||
|
||
/** | ||
* @param args 0: mount point, 1: email | ||
*/ | ||
public static void main(String[] args) throws Exception { | ||
if (args.length != 2) { | ||
System.err.println("Usage: DropBoxFS <mountpoint> <email>"); | ||
System.exit(1); | ||
} | ||
|
||
String email = args[1]; | ||
|
||
URI uri = URI.create("dropbox:///?id=" + email); | ||
|
||
OAuth2AppCredential appCredential = new DropBoxLocalAppCredential(); | ||
|
||
// System.setProperty("vavi.net.fuse.FuseProvider.class", "vavi.net.fuse.javafs.JavaFSFuseProvider"); | ||
// System.setProperty("vavi.net.fuse.FuseProvider.class", "vavi.net.fuse.jnrfuse.JnrFuseFuseProvider"); | ||
|
||
Map<String, Object> env = new HashMap<>(); | ||
env.put(DropBoxFileSystemProvider.ENV_APP_CREDENTIAL, appCredential); | ||
env.put("ignoreAppleDouble", true); | ||
|
||
FileSystem fs = new DropBoxFileSystemProvider().newFileSystem(uri, env); | ||
|
||
Fuse.getFuse().mount(fs, args[0], Collections.emptyMap()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2016 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package com.github.fge.fs.dropbox; | ||
|
||
import java.net.URI; | ||
import java.util.Collections; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static vavi.nio.file.Base.testAll; | ||
|
||
|
||
/** | ||
* Main. (java fs, dropbox) | ||
* | ||
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer) | ||
* @version 0.00 2019/07/11 umjammer initial version <br> | ||
*/ | ||
public class Main { | ||
|
||
@Test | ||
void test01() throws Exception { | ||
String email = System.getenv("DROPBOX_TEST_ACCOUNT"); | ||
|
||
URI uri = URI.create("dropbox:///?id=" + email); | ||
|
||
testAll(new DropBoxFileSystemProvider().newFileSystem(uri, Collections.emptyMap())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2016 by Naohide Sano, All rights reserved. | ||
* | ||
* Programmed by Naohide Sano | ||
*/ | ||
|
||
package com.github.fge.fs.dropbox; | ||
|
||
import java.net.URI; | ||
import java.nio.file.FileSystem; | ||
import java.util.Collections; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static vavi.nio.file.Base.testLargeFile; | ||
|
||
|
||
/** | ||
* DropBox. (v2) | ||
* | ||
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer) | ||
* @version 0.00 2016/03/xx umjammer initial version <br> | ||
*/ | ||
public class Main2 { | ||
|
||
@Test | ||
void test01() throws Exception { | ||
String email = System.getenv("DROPBOX_TEST_ACCOUNT"); | ||
|
||
URI uri = URI.create("dropbox:///?id=" + email); | ||
FileSystem fs = new DropBoxFileSystemProvider().newFileSystem(uri, Collections.emptyMap()); | ||
|
||
testLargeFile(fs, null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
package com.github.fge.fs.dropbox; | ||
|
||
import java.net.URI; | ||
import java.nio.file.FileSystem; | ||
import java.util.Collections; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import vavi.util.properties.annotation.PropsEntity; | ||
|
||
import static vavi.nio.file.Base.testMoveFolder; | ||
|
||
|
||
/** | ||
* dropbox move folder. | ||
* | ||
* @author <a href="mailto:umjammer@gmail.com">Naohide Sano</a> (umjammer) | ||
* @version 0.00 2016/03/21 umjammer initial version <br> | ||
*/ | ||
@PropsEntity(url = "file://${HOME}/.vavifuse/dropbox/{0}") | ||
public final class Main3 { | ||
|
||
@Test | ||
void test01() throws Exception { | ||
String email = System.getenv("DROPBOX_TEST_ACCOUNT"); | ||
|
||
URI uri = URI.create("dropbox:///?id=" + email); | ||
FileSystem fs = new DropBoxFileSystemProvider().newFileSystem(uri, Collections.emptyMap()); | ||
|
||
testMoveFolder(fs); | ||
} | ||
} |
Oops, something went wrong.