Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pron committed Sep 5, 2015
0 parents commit 158438c
Show file tree
Hide file tree
Showing 52 changed files with 8,655 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DS_Store
/dist/
/out/
_site/
/docs/javadoc/
.idea/
*.iml
/artifacts
/nbproject/private/
/.nb-gradle
/build
/*/build/
.gradle/
.nb-gradle-properties
Gemfile.lock
/push_docs.sh
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fuse-jna</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
99 changes: 99 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Copyright (c) 2015 Parallel Universe
Copyright (c) 2012-2015 Etienne Perot. All rights reserved.
Copyright (c) 2015 Sergey Tselovalnikov

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY ETIENNE PEROT ''AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the
authors and should not be interpreted as representing official policies, either expressed
or implied, of Etienne Perot.

Copyright 2012 Etienne Perot. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY ETIENNE PEROT ''AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the
authors and should not be interpreted as representing official policies, either expressed
or implied, of Etienne Perot.

---

The MIT License (MIT)

Copyright (c) 2015 Sergey Tselovalnikov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# JavaFS
## Java filesystems as FUSE

## Requirements

Java 7 and up.

Your OS must support FUSE or have it installed.

## Usage

The API consists of a single class with two methods:

JavaFS.mount, which mounts a Java `FileSystem` as FUSE filesystem, and

JavaFS.unmount, which unmounts a FUSE filesystem

## Test

```
./run.sh [-r] <mountpoint> [<zipfile>]
```

#### Compatibility

* OS X with [MacFUSE]/[fuse4x]/[OSXFUSE] on Intel architectures
* Linux with [FUSE][Linux-Fuse] on Intel, PowerPC and ARM architectures
* FreeBSD with [FUSE][FreeBSD-Fuse] on Intel architectures

## Project Information

This is essentially a port of [fuse-jna], by Etienne Perot, from [JNA] to [JNR],
with some code copied from [jnr-fuse], by Sergey Tselovalnikov, made to work with the standard JDK [FileSystem] API.

* Differences from [fuse-jna]: this project uses [JNR] rather than [JNA].
* Differences from [jnr-fuse]: this project support Java 7 (jnr-fuse supports only Java 8), and more platforms (like Mac).
* Differences from both: rather than exposing a new, specific, Java FUSE API, this project uses the standard [FileSystem] API.

## License

```
Copyright (c) 2015 Parallel Universe
Copyright (c) 2012-2015 Etienne Perot. All rights reserved.
Copyright (c) 2015 Sergey Tselovalnikov
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

This is the 2-clause BSD license.

[fuse-jna] is licensed under the [BSD 2-Clause License].

[jnr-fuse] is licensed under the [MIT License].


[fuse-jna]: https://github.com/EtiennePerot/fuse-jna
[jnr-fuse]: https://github.com/SerCeMan/jnr-fuse
[FileSystem]: http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html
[JNA]: https://github.com/java-native-access/jna
[JNR]: https://github.com/jnr
[MacFUSE]: http://code.google.com/p/macfuse/
[fuse4x]: http://fuse4x.org/
[OSXFUSE]: http://osxfuse.github.com/
[Linux-FUSE]: http://fuse.sourceforge.net/
[FreeBSD-FUSE]: http://wiki.freebsd.org/FuseFilesystem
[BSD 2-Clause License]: http://www.opensource.org/licenses/bsd-license
[MIT License]: http://opensource.org/licenses/MIT
138 changes: 138 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
plugins {
id 'java'
id 'maven'
id 'signing'
}

sourceCompatibility = '1.7'
targetCompatibility = '1.7'

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

group = "co.paralleluniverse"
version = "0.1.0-SNAPSHOT"
status = "integration"
description = "Java FileSystem as FUSE"
ext.url = "http://puniverse.github.com/jfuse"
ext.vendor = "Parallel Universe Software Co."
ext.licenseName = "GNU General Public License, version 2, with the Classpath Exception"
ext.licenseUrl = "http://openjdk.java.net/legal/gplv2+ce.html"
ext.scmUrl = "https://github.com/puniverse/jfuse"
ext.scmConnection = "https://github.com/puniverse/jfuse.git"

ext.distDir = "$buildDir/dist"
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

repositories {
mavenCentral()
}

dependencies {
compile 'com.github.jnr:jnr-ffi:2.0.3'
compile 'com.github.jnr:jnr-posix:3.0.17'

testCompile 'junit:junit:4.12'
testCompile 'org.truth0:truth:0.23'
testCompile 'com.google.jimfs:jimfs:1.0'
}

tasks.withType(JavaExec) {
classpath += sourceSets.test.runtimeClasspath
}

javadoc {
options {
links = [ "http://docs.oracle.com/javase/7/docs/api/" ]
noDeprecated = true
addStringOption('public', '-quiet')
}
excludes = [
"co/paralleluniverse/fuse/**",
"jnr/**",
]
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives jar
archives sourcesJar
archives javadocJar
}

signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

if (!project.hasProperty("sonatypeUsername") || !project.hasProperty("sonatypePassword")) {
println "sonatype username or password not set"
ext.sonatypeUsername = ""
ext.sonatypePassword = ""
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }

repository(
url: (isReleaseVersion ?
"https://oss.sonatype.org/service/local/staging/deploy/maven2" :
"https://oss.sonatype.org/content/repositories/snapshots")) {
// User and Password are taken from ~/.gradle/gradle.properties
authentication(userName: project.sonatypeUsername, password: project.sonatypePassword)
}
pom.project {
name project.name
packaging 'jar'
description project.description
url project.url
scm {
url project.scmUrl
connection project.scmConnection
developerConnection project.scmConnection
}
licenses {
license {
name project.licenseName
url project.licenseUrl
distribution 'repo'
}
}
developers {
developer {
id 'pron'
name 'Ron Pressler'
}
}
}
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}


task('run', type: JavaExec, dependsOn:[testClasses]) {
classpath = sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath

main = 'co.paralleluniverse.javafs.Main'

if(project.hasProperty('args')){
args project.args.split('\\s+')
}

// systemProperty 'jnr.ffi.compile.dump', 'true'
}

Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Fri Sep 04 17:18:36 IDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
Loading

0 comments on commit 158438c

Please sign in to comment.