Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding wrappers for high-level programming #32

Open
JaniruTEC opened this issue Mar 24, 2020 · 2 comments · May be fixed by #35
Open

Adding wrappers for high-level programming #32

JaniruTEC opened this issue Mar 24, 2020 · 2 comments · May be fixed by #35
Assignees
Milestone

Comments

@JaniruTEC
Copy link
Member

Hello, just my first time diving into Dokany and dokan-java.
Looking at the API I noticed that many classes like DokanyFileSystemStub are closer to "C-Code" than to default Java OOP-Approached classes. They only return ints and handle returns via callbacks or use WString as parameters.

Are there plans to include a more OOP/Java-like API? Is this something I could contribute?

@infeo
Copy link
Member

infeo commented Apr 23, 2020

Well, since this library is first and foremost a wrapper for dokany, it is no wonder that it resembles c code.

Of course a more Java-like approach is desirable, but difficult to realize. In the end the developer needs to implement the dokany api, which expects status codes as return values and gives you pointers and bit masks as parameters.

But i'm open for suggestions (:

@JaniruTEC
Copy link
Member Author

JaniruTEC commented Apr 25, 2020

I've been working on a java-like-approach for some time now.
If you were to add a second layer, the library could handle translation from bitmasks into EnumIntegerSets and could translate pointers to/from wrapper classes (e.g. I created a class "DiskSpaceInfo" to wrap the space parameters for getDiskFreeSpace)

Also my approach to status codes would have been to throw exceptions which are handled and translated by the second layer.

Is there a way to contact you outside of GitHub, as I have trouble getting my test environment for the current snapshot version set up and got a couple more questions.

JaniruTEC added a commit to JaniruTEC/dokan-java that referenced this issue May 5, 2020
Added DokanFileInfoFlag to aid in creating a wrapper ("DokanFileHandle") for DokanFileInfo's getters (e.g. isDirectory())
Added FileShareAccess to wrap paramter rawShareAccess of DokanyFileSystem#zwCreateFile to aid in creating a wrapper ("EasyDokanFileSystem") for DokanyFileSystem
Added MicrosoftReparsePointTag to wrap field dwReserved0 of WinBase.WIN32_FIND_DATA to aid in creating a wrappe ("FindFileInfo") for WinBase.WIN32_FIND_DATA (used by DokanyFileSystem#findFiles)

This commit is part of my effort to fix dokan-java's issue 32 (dokan-dev#32): Adding wrappers for high-level programming
JaniruTEC added a commit to JaniruTEC/dokan-java that referenced this issue May 7, 2020
Added EasyFileInfo to wrap the result of DokanyFileSystem#getFileInformation (ByHandleFileInformation)
and Added FindFileInfo to wrap the result of DokanyFileSystem#findFiles (WinBase.WIN32_FIND_DATA) to aid in creating a wrapper ("EasyDokanFileSystem") for DokanyFileSystem
Added AbstractFileInfo as common base class for FileInfos (like EasyFileInfo and FindFileInfo)
Added DefaultFileTimePolicy to help in returning valid FileTimes to Dokan if unavailable to AbstractFileInfo

This commit is part of my effort to fix dokan-java's issue 32 (dokan-dev#32): Adding wrappers for high-level programming
JaniruTEC added a commit to JaniruTEC/dokan-java that referenced this issue May 7, 2020
Restored VolumeInformation from commit 99bcbda (party reverting commit 3c343eb) to wrap the result of DokanyFileSystem#getVolumeInformation to aid in creating a wrapper ("EasyDokanFileSystem") for DokanyFileSystem

This commit is part of my effort to fix dokan-java's issue 32 (dokan-dev#32): Adding wrappers for high-level programming
JaniruTEC added a commit to JaniruTEC/dokan-java that referenced this issue May 9, 2020
Added DesiredAccessMask to wrap parameter desiredAccess of DokanyFileSystem#zwCreateFile to aid in creating a wrapper ("EasyDokanFileSystem") for DokanyFileSystem
Added DiskSpaceInfo to wrap the result of DokanyFileSystem#getDiskFreeSpace to  aid in creating a wrapper ("EasyDokanFileSystem") for DokanyFileSystem

This commit is part of my effort to fix dokan-java's issue 32 (dokan-dev#32): Adding wrappers for high-level programming
@infeo infeo added this to the 2.0 milestone May 21, 2020
JaniruTEC added a commit to JaniruTEC/dokan-java that referenced this issue May 28, 2020
Added MountInfo-API to wrap the class DokanOptions for the respective field in DokanFileHandle (wrapper for DokanFileInfo).
Added Interfaces ROMountInfo and RWMountInfo
Added ImmutableMountInfo and MountInfo as implementations

This commit is part of my effort to fix dokan-java's issue dokan-dev#32
JaniruTEC added a commit to JaniruTEC/dokan-java that referenced this issue May 28, 2020
Added ForwardingFileSystem as delegator for method-calls between EasyDokanFileSystem-implementations and DokanFileSystem-API
Added EasyDokanFileSystemStub as stub for implementations of EasyDokanFileSystem (similiar to DokanFileSystemStub)
Added AbstractEasyDokanFileSystem as base class for implementations of EasyDokanFileSystem (similiar to AbstractDokanFileSystem)

This commit is part of my effort to fix dokan-java's issue dokan-dev#32
@JaniruTEC JaniruTEC linked a pull request Jun 2, 2020 that will close this issue
@JaniruTEC JaniruTEC self-assigned this Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants