dokan-dev / dokan-java

Dokan Java Wrapper
GNU Lesser General Public License v3.0
51 stars 28 forks source link

[Question] Pass-through functionality? #22

Closed hrstoyanov closed 4 years ago

hrstoyanov commented 4 years ago

Hi, I ma new to dokan-java. Is there a way to implemented a "pass-through" file system: e.g. you only decorate certain operations (like file write) and otherwise pass through to the underlying default NTFS filesystem for operations that you don't care to implement or decorate?

I would like to implement a driver that only intercepts "file writes" but all other operations are delegated to NTFS, including the intercepted file writes.

Thanks

infeo commented 4 years ago

No. That would be cool and a possible feature request.

Basically you need to implement all methods which should be handled. If a method is not implemented, its functionality is not given in the actual file system. So if you want to pass through reading files, you need to implement the method readFile(...) . Note that there are also methods which you cannot easily pass through like reading NTFS-specific extended attributes or setting the security descriptor. In these cases you need to use either JNI or program it yourself.

A pass through example for the "standard" methods can be found cryptomator/dokany-nio-adapter. It relies on an old but similar version of dokan-java. For the more windows specifc functions there does not exist an implementation.

Am 19. Dezember 2019 01:59:03 MEZ schrieb Hristo I Stoyanov notifications@github.com:

Hi, I ma new to dokan-java. Is there a way to implemented a "pass-through" file system: e.g. you only decorate certain operations (like file write) and otherwise pass through to the underlying default NTFS filesystem for operations that you don't care to implement or decorate?

I would like to implement a driver that only intercepts "file writes" but all other operations are delegated to NTFS, including the intercepted file writes.

Thanks

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/dokan-dev/dokan-java/issues/22

hrstoyanov commented 4 years ago

@infeo Thanks for the pointers, I will take a look. I agree implementing something like abstract class that "passes through" operations the developers does not want to deal with and allows to "intercept" only some would be valuable and saves a lot of unnecessary code. I will look into this more!

hrstoyanov commented 4 years ago

@infeo I will close this thread as it is a question, not a bug. Feel free to re-open it as an "enhancement" feature.