Coder Social home page Coder Social logo

nio-fs-provider's Introduction

nio-fs-provider

FileSystemProviders for java.nio introduced in Java 7. From version 3.0.0, only Java 17 is supported.

It allows File system operation agnostic to the underlying implementation, much like Apache VFS, but now in standard Java.

NB: The project has moved in Maven Central. This library was previously published with groupId no.uis.nio in Maven Central. Version 1.1.7 is the last version under this groupId.

Newer versions are published with groupId no.maddin.niofs.


Get more details at codescene.io.

nio-fs-provider's People

Contributors

dependabot[bot] avatar laeubi avatar maddingo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nio-fs-provider's Issues

Cannot build HEAD

Dear Martin,

looking for a way to access Nexus programmatically, i found your wonderful filesystem provider depot. Trying maven 3.2.3 to build HEAD, i'm experiencing an error though:

http://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound

Looks like this is so common maven People have already contributed a dedicated site for it. Seems like a Problem in the maven Version used to build. Maybe you want to use the maven enforcer plugin to make sure People use maven 3.0?

Anyway, mvn 3.0.5 runs like a charm...

some rather large updates for webdav-nio-fs-provider

hi, I've made some rather large updates for the webdav-nio-fs-provider

WebdavFileSystemProvider.java

  • updated newDirectoryStream, this now pulls a list of files/folders from a webdav directory and returns it as a Directory Stream
  • while doing that it maintains a list of attributes in a cache of the files/folders listed (during the propfind webdav command)
  • (this adds a dependency on https://github.com/ben-manes/caffeine cache
<dependency>
	<groupId>com.github.ben-manes.caffeine</groupId>
	<artifactId>caffeine</artifactId>
	<version>2.9.3</version>  
</dependency>
  • edit: some code cleanups for newDirectoryStream and handles filter appripriately
  • updated readAttributes(Path path, Class type, LinkOption... options)
  • updated readAttributes(Path path, String attributes,
    the above 2 methods now read the file attributes e.g. for Files.size(), Files.getLastModifiedTime() etc.
    In addition, it'd retrieve from the attribute cache, rather than hitting the server in round trips for each file.
    original code has a little 'bug' in that, the call to Sardine.list() should specify 0 as the depth and allprops as true.
	resources = wfs.getSardine().list(path.toUri().toString(),0,true);
        //List<DavResource> resources = wfs.getSardine().list(path.toUri().toString());
  • added apache log4j2 for debugging and warning/error messages, that may be useful as some of the java.nio calls do not return messages.

WebdavPath.java

  • quite a lot of methods that originally returns unsupported operations exception is implemented
    they turned out to be quite useful, e.g. that compareTo is commonly used for sorting the directory list
  • a major change is the path elements is represented as an ArrayList and added an isAbsolute flag.

WebdavFileSystem.java

  • the attribute cache lives here as it is relevant to each filesystem (host)
  • I made some changes in constructor so that it uses the initial path in the url to connect as the root path.
  • some fixes for unauthenticated login i.e. when username:password are both null
    tested against this android app
    https://play.google.com/store/apps/details?id=slowscript.httpfileserver
  • fix for case of null password e.g. "username:"

the full set of codes of the 3 files is in this gist
https://gist.github.com/ag88/5d8c5246bf200f25159348d315109552
There are possibly other files that i've touched hence this is incomplete. It mainly list the major changes.

I'm wondering if you may be keen to merge the above codes?
As if you do, I can make a pull request from github.
A thing is while I've tested the above codes in a little app against this webdav servlet
https://sourceforge.net/projects/webdav-servlet/
Pulling a directory list from a large linux home directory, with the servlet runnig and listing from there.
I'm not sure if there are things I may have missed. The tests are mostly in read only mode for now, i.e. pulling data from server.
Another thing is I'm insisting on targetting jdk-1.8, java 8 hence the codes are written against jdk 1.8 API.
This would make it easier to release binaries for both jdk-1.8 and later java versions, it is quite likely pulls from maven central needs binaries between 1.8 - current rather than the current java versions.

Spaces in URI lead to an Exception

I know, that nothing has happened on this project for quite some time, but I stumbled accros it while struggeling with JCIFS.
Looks much cleaner, but there is a minor bug:
no.uis.nio.smb.SMBDirectoryStream#iterator
When you try to create a URI for a path containing spaces, like "Documents and Settings", the Stream crashes. It's easy to prevent by replacing

SMBPath p = new SMBPath(provider, file.getURL().toURI());

with something like

URI fileUri = new URI(file.getURL().toString().replace(" ", "%20"));
SMBPath p = new SMBPath(provider, fileUri);

Just if your are still interessted in this at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.