Skip to content

Commit

Permalink
Merge pull request #6 from umjammer/0.0.21
Browse files Browse the repository at this point in the history
0.0.21
  • Loading branch information
umjammer authored Feb 27, 2024
2 parents 998322c + f3255b7 commit 8796dc3
Show file tree
Hide file tree
Showing 9 changed files with 291 additions and 16 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ name: "CodeQL"

on:
push:
branches: [api-v2-compliant]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [api-v2-compliant]
branches: [main]
# schedule:
# - cron: '0 2 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
Expand All @@ -30,11 +34,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -45,7 +49,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -65,4 +69,4 @@ jobs:
run: mvn -B package --file pom.xml -DskipTests

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check w/o SNAPSHOT when "bump version"
if: ${{ contains(github.event.head_commit.message, 'bump version') }}
run: grep "<version>" pom.xml | head -1 | grep -v SNAPSHOT

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ https://github.com/umjammer/vavi-apps-fuse/blob/master/vavi-nio-file-gathered/sr
## TODO

* ~~project name to vavi-nio-file-dropbox~~
* rename main branch
33 changes: 25 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

<groupId>com.github.fge</groupId>
<artifactId>vavi-nio-file-dropbox</artifactId>
<version>0.0.20v</version>
<version>0.0.21</version>

<name>java7-fs-dropbox</name>
<name>vavi-nio-file-dropbox</name>
<description>A Java 7 FileSystem implementation over DropBox</description>
<url>https://github.com/umjammer/vavi-nio-file-dropbox</url>
<scm>
Expand All @@ -18,6 +18,9 @@
<properties>
<vavi-nio-file-base.groupId>com.github.umjammer</vavi-nio-file-base.groupId> <!-- com.github.fge / com.github.umjammer -->
<vavi-nio-file-base.version>0.0.14v</vavi-nio-file-base.version>

<vavi-nio-file-fuse.groupId>com.github.umjammer</vavi-nio-file-fuse.groupId> <!-- vavi / com.github.umjammer -->
<vavi-nio-file-fuse.version>0.0.16</vavi-nio-file-fuse.version>
</properties>

<profiles>
Expand Down Expand Up @@ -149,12 +152,6 @@
<version>0.1.9</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-client-impl</artifactId>
<version>9.4.53.v20231009</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand All @@ -170,6 +167,11 @@
<artifactId>junit-platform-commons</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${vavi-nio-file-base.groupId}</groupId>
Expand All @@ -179,6 +181,21 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>${vavi-nio-file-fuse.groupId}</groupId>
<artifactId>vavi-nio-file-fuse</artifactId>
<version>${vavi-nio-file-fuse.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${vavi-nio-file-fuse.groupId}</groupId>
<artifactId>vavi-nio-file-fuse</artifactId>
<version>${vavi-nio-file-fuse.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.rainerhahnekamp</groupId>
<artifactId>sneakythrow</artifactId>
Expand Down
54 changes: 54 additions & 0 deletions src/test/java/com/github/fge/fs/dropbox/DropBoxFS.java
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());
}
}
33 changes: 33 additions & 0 deletions src/test/java/com/github/fge/fs/dropbox/Main.java
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()));
}
}
35 changes: 35 additions & 0 deletions src/test/java/com/github/fge/fs/dropbox/Main2.java
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);
}
}
32 changes: 32 additions & 0 deletions src/test/java/com/github/fge/fs/dropbox/Main3.java
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);
}
}
Loading

0 comments on commit 8796dc3

Please sign in to comment.