dokan-dev / dokan-java

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

Implementing the "Easy"-Dokan-API #35

Open JaniruTEC opened 4 years ago

infeo commented 4 years ago

As it was discussed between @JaniruTEC and me: The file system should give a developer the Win32API Flags and should return Win32API error codes, which will be automically converted to an NtStatus code (via DokanNtStatusFromWin32Error)

Liryna commented 4 years ago

@infeo Does Win32 error are usually used by Java developers? Like they would understand easier the usage compared to ntstatus?

infeo commented 4 years ago

I don't want to speak for every Java developer out there, but from my experience it is. As an example, let's look at the case if an object alrady exists:

As a Java dev you are used to nio exceptions like FileAlreadyExistsException, which directly translates to the win32 error code in this case.

The filesystem proposed in this PR should be easier for developers to use and more Javaish, and from my point of view the normal developer deals either only with Java or at most the win32API, but not the Kernel. Of course it would be more desireable to do it more the Java way and catch exceptions and translate those directly to the correct error code, but i thought one step at a time (;

this won't replace the old filesystem. A developer has the possiblitly to choose between the more raw filesystem to implement (less Java, more bitmasks and needs to return NTStatus) and the easy one (more Java, gives user land flags and returns win32 codes)

infeo commented 4 years ago

@Liryna What is your opinion? Is it a good plan to use Win32 API codes and flags or should we stick to the Kernel-Layer in the easier-to-use-filesystem?

Liryna commented 4 years ago

Thank for your detail! case like FileAlreadyExistsException is exactly what I was looking for. I also believe win32 would be a good choice as it make more sense for Java devs 👍