Questions tagged [jsr203]

JSR 203 is the umbrella under which the new (for Java 7) file API (also known as NIO2) was created. JSR 203 allows to have FileSystem implementations over any storage medium which can be viewed as a filesystem from a user perspective; the JRE provides a default implementation for your local machine, but also a provider for FileSystems over zip files. Other implementations exist over FTP, DropBox, box.com, in memory and a few others.

5 questions
6
votes
1 answer

How to write a FileTypeDetector for zip archives?

For this package, one of my next steps is to write a series of FileTypeDetector to have the method Files.probeContentType() be smarter than what is is by default (the default provided file type detector relies on "file name extensions" only). As the…
fge
  • 119,121
  • 33
  • 254
  • 329
6
votes
4 answers

creating a virtual file system with JIMFS

I'd like to use Google's JIMFS for creating a virtual file system for testing purposes. I have trouble getting started, though. I looked at this tutorial: http://www.hascode.com/2015/03/creating-in-memory-file-systems-with-googles-jimfs/ However,…
user3629892
  • 2,960
  • 9
  • 33
  • 64
1
vote
1 answer

Using FileSystemProvider to Implement an FTP file system

I have developed an app that detects changes in a file system using Java's java.nio.file.WatchService This works great when setting up a WatchService for the default filesystem: watchService = FileSystems.getDefault().newWatchService(); The use…
JRM
  • 11
  • 3
0
votes
0 answers

Is a single JSR203 store with a root per-commit a reasonable design for a Git filesystem layer?

I would like to implement a jsr203 file system for accessing git history. Thus, create a path that represents a file in a specific commit, retrieve its content by letting the file system access the .git folder under the cover and read the history,…
Olivier Cailloux
  • 977
  • 9
  • 24
0
votes
1 answer

Represent a `Path` starting with a `\` but without a disk drive, under Windows

I do not own a Windows copy, but would like to know the behavior and recommended usage in Java for representing a path such as \autoexec.bat under Windows? Semantically, such a path would represent the file autoexec.bat on the root of any file…
Olivier Cailloux
  • 977
  • 9
  • 24