Skip to content

Commit

Permalink
Added multiple Enums to wrap native bitmasks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JaniruTEC committed May 5, 2020
1 parent ecda6a6 commit 64f66e4
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=dokan-java
version=1.1.1
version=1.2.0-SNAPSHOT
group=dev.dokan
artifact=dokan-java
description=A Java wrapper for Dokany (https://dokan-dev.github.io/)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package dev.dokan.dokan_java.constants.dokany;

import dev.dokan.dokan_java.constants.EnumInteger;

/**
* [TO BE REPLACED WITH LICENSE NOTE]
*/
public enum DokanFileInfoFlag implements EnumInteger {

DELETE_ON_CLOSE(1),
IS_DIRECTORY(2),
NO_CACHE(4),
PAGING_IO(8),
SYNCHRONOUS_IO(16),
WRITE_TO_END_OF_FILE(32);

private final int mask;

DokanFileInfoFlag(int mask) {
this.mask = mask;
}

@Override
public int getMask() {
return this.mask;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dev.dokan.dokan_java.constants.microsoft;

import dev.dokan.dokan_java.constants.EnumInteger;

public enum FileShareAccess implements EnumInteger {

FILE_SHARE_READ(1),
FILE_SHARE_WRITE(2),
FILE_SHARE_DELETE(4);

private final int mask;

FileShareAccess(int mask) {
this.mask = mask;
}

@Override
public int getMask() {
return this.mask;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package dev.dokan.dokan_java.constants.microsoft;

import dev.dokan.dokan_java.constants.EnumInteger;

/**
* [TO BE REPLACED WITH LICENSE NOTE]
*/
public enum MicrosoftReparsePointTag implements EnumInteger {

IO_REPARSE_TAG_CSV(0x80000009),
IO_REPARSE_TAG_DEDUP(0x80000013),
IO_REPARSE_TAG_DFS(0x8000000A),
IO_REPARSE_TAG_DFSR(0x80000012),
IO_REPARSE_TAG_HSM(0xC0000004),
IO_REPARSE_TAG_HSM2(0x80000006),
IO_REPARSE_TAG_MOUNT_POINT(0xA0000003),
IO_REPARSE_TAG_NFS(0x80000014),
IO_REPARSE_TAG_SIS(0x80000007),
IO_REPARSE_TAG_SYMLINK(0xA000000C),
IO_REPARSE_TAG_WIM(0x80000008);

private final int mask;

MicrosoftReparsePointTag(int mask) {
this.mask = mask;
}

@Override
public int getMask() {
return this.mask;
}
}

0 comments on commit 64f66e4

Please sign in to comment.