Forums Register Login

Custom WebDAVFileSystem with Java NIO

+Pie Number of slices to send: Send
Hey Guys,

I have an Java application with lots of NIO methods like Files.copy, Files.move, Files.delete, FileChannel.. My web application actually works fine with the default UnixFileSystem  and an EncryptedFileSystem to encrypt the physical data on your local machine. What I now trying to achieve: I want to access a remote WebDAV server and modify data on that server with the basic functions like upload, delete or update the remote WebDAV data - without changing every method on my application. So here comes my idea:

I think an WebDAV FileSystem implementation would do the trick. Adding a custom WebDAV FileSystemProvider which is managing the mentioned file operations on the remote data. I've googled a lot and the Apache VFS with Sardine implementation looks good - BUT it seems that the Apache VFS is not compatible with NIO?

Here's some example code:



After that I want to work in my application with localPath1 + localPath2. So that e.g. a Files.copy(localPath1, newRemotePath) would copy a file on the WebDAV server to a new directory.

Is this the right course of action? Or are there other libraries to achieve that?

Thanks for your ideas/advice's,
Jan
Hey cool! They got a blimp! But I have a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1190 times.
Similar Threads
Windows XP Compressed Folders doesn't recognize my Java-created zip file
Apache Common VFS
Reading remote file - difference between linux and windows deployments
VFS concurreny problem while using webdav [couldn't determine type of file.
Facing a problem during monitor the files using org.apache.commons.vfs api
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:55:44.