dokan-java icon indicating copy to clipboard operation
dokan-java copied to clipboard

Implementing the "Easy"-Dokan-API

Open JaniruTEC opened this issue 5 years ago • 5 comments

JaniruTEC avatar May 04 '20 17:05 JaniruTEC

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)

infeo avatar May 28 '20 20:05 infeo

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

Liryna avatar May 28 '20 20:05 Liryna

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:

  • The win32 error code is ERROR_ALREADY_EXISTS
  • the ntstatus is STATUS_OBJECT_NAME_COLLISION

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 avatar May 28 '20 21:05 infeo

@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?

infeo avatar May 29 '20 22:05 infeo

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 👍

Liryna avatar May 30 '20 11:05 Liryna