Skip to content

Commit

Permalink
Merge branch 'feature/#37-fixNamingConvention' into develop
Browse files Browse the repository at this point in the history
closes #37
  • Loading branch information
Armin Schrenk committed May 20, 2020
2 parents 8c691bf + dbd6cf6 commit 6c5f9c7
Show file tree
Hide file tree
Showing 20 changed files with 184 additions and 184 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
package dev.dokan.dokan_java;

public final class DokanyException extends RuntimeException {
public final class DokanException extends RuntimeException {

private final int errorCode;

public DokanyException(Exception e) {
public DokanException(Exception e) {
super(e);
this.errorCode = Integer.MIN_VALUE;
}

public DokanyException(String message) {
public DokanException(String message) {
super(message);
this.errorCode = Integer.MIN_VALUE;
}
public DokanyException(String message, int errorCode) {
public DokanException(String message, int errorCode) {
super(message);
this.errorCode = errorCode;
}

public DokanyException(Throwable cause, int errorCode) {
public DokanException(Throwable cause, int errorCode) {
super(cause);
this.errorCode = errorCode;
}

public DokanyException(String message, Throwable cause) {
public DokanException(String message, Throwable cause) {
super(message, cause);
this.errorCode = Integer.MIN_VALUE;
}

public DokanyException(String message, Throwable cause, int errorCode) {
public DokanException(String message, Throwable cause, int errorCode) {
super(message, cause);
this.errorCode = errorCode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Main interface to implement. These methods will be registered in the dokany kernel driver to handle filesystem requests.
*/
public interface DokanyFileSystem extends Mountable {
public interface DokanFileSystem extends Mountable {

/**
* CreateFile Dokan API callback.
Expand All @@ -33,7 +33,7 @@ public interface DokanyFileSystem extends Mountable {
* to TRUE. On the other hand, if {@link DokanFileInfo#IsDirectory} is set to TRUE but the path targets a file, {@link NtStatuses#STATUS_NOT_A_DIRECTORY} must be returned.
* <p>
* {@link DokanFileInfo#Context} can be used to store Data (like a filehandle) that can be retrieved in all other requests related to the Context. To avoid memory leak, Context needs to be released in {@link
* DokanyFileSystem#cleanup(WString, DokanFileInfo)} .
* DokanFileSystem#cleanup(WString, DokanFileInfo)} .
*
* @param rawPath Path requested by the Kernel on the File System. TODO: rewrite this parameter description to link to winBase
* @param securityContext the security context of the kernel (see also in the windows driver API <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/ns-wdm-_io_security_context">IO_SECURITY_CONTEXT</a>)
Expand Down Expand Up @@ -62,7 +62,7 @@ int zwCreateFile(
/**
* Receipt of this request indicates that the last handle for a file object that is associated with the target device object has been closed (but, due to outstanding I/O requests, might not have been released).
* <p>
* Cleanup is requested before @{link {@link DokanyFileSystem#closeFile(WString, DokanFileInfo)} is called.
* Cleanup is requested before @{link {@link DokanFileSystem#closeFile(WString, DokanFileInfo)} is called.
*
* @param rawPath
* @param dokanFileInfo {@link DokanFileInfo} with information about the file or directory.
Expand All @@ -75,7 +75,7 @@ void cleanup(
* CloseFile is called at the end of the life of the context. Receipt of this request indicates that the last handle of the file object that is associated with the target device object has been closed and released.
* All outstanding I/O requests have been completed or canceled.
* <p>
* CloseFile is requested after {@link DokanyFileSystem#cleanup(WString, DokanFileInfo)} is called. Anything remaining in {@link DokanFileInfo#Context} has to be cleared before return.
* CloseFile is requested after {@link DokanFileSystem#cleanup(WString, DokanFileInfo)} is called. Anything remaining in {@link DokanFileInfo#Context} has to be cleared before return.
*
* @param rawPath
* @param dokanFileInfo {@link DokanFileInfo} with information about the file or directory.
Expand All @@ -85,7 +85,7 @@ void closeFile(
DokanFileInfo dokanFileInfo);

/**
* ReadFile callback on the file previously opened in {@link DokanyFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)}. It can be called by different thread at the
* ReadFile callback on the file previously opened in {@link DokanFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)}. It can be called by different thread at the
* same time, therefore the read has to be thread safe.
*
* @param rawPath
Expand All @@ -105,7 +105,7 @@ int readFile(
DokanFileInfo dokanFileInfo);

/**
* WriteFile callback on the file previously opened in {@link DokanyFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)} It can be called by different thread at the
* WriteFile callback on the file previously opened in {@link DokanFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)} It can be called by different thread at the
* same time, therefore the write/context has to be thread safe.
*
* @param rawPath
Expand Down Expand Up @@ -159,11 +159,11 @@ int getFileInformation(
*/
int findFiles(
WString rawPath,
DokanyOperations.FillWin32FindData rawFillFindData,
DokanOperations.FillWin32FindData rawFillFindData,
DokanFileInfo dokanFileInfo);

/**
* Same as {@link DokanyFileSystem#findFiles(WString, DokanyOperations.FillWin32FindData, DokanFileInfo)} but with a search pattern to filter the result.
* Same as {@link DokanFileSystem#findFiles(WString, DokanOperations.FillWin32FindData, DokanFileInfo)} but with a search pattern to filter the result.
*
* @param fileName
* @param searchPattern
Expand All @@ -174,7 +174,7 @@ int findFiles(
int findFilesWithPattern(
WString fileName,
WString searchPattern,
DokanyOperations.FillWin32FindData rawFillFindData,
DokanOperations.FillWin32FindData rawFillFindData,
DokanFileInfo dokanFileInfo);

/**
Expand Down Expand Up @@ -213,10 +213,10 @@ int setFileTime(
* You should NOT delete the file in this method, but instead you must only check whether you can delete the file or not, and return {@link NtStatuses#STATUS_SUCCESS} (when you can delete it) or appropriate error
* codes such as {@link NtStatuses#STATUS_ACCESS_DENIED}, {@link NtStatuses#STATUS_OBJECT_NO_LONGER_EXISTS}, {@link NtStatuses#STATUS_OBJECT_NAME_NOT_FOUND}.
* <p>
* {@link DokanyFileSystem#deleteFile(WString, DokanFileInfo)} will also be called with {@link DokanFileInfo#DeleteOnClose} set to <i>false</i> to notify the driver when the file is no longer requested to be
* {@link DokanFileSystem#deleteFile(WString, DokanFileInfo)} will also be called with {@link DokanFileInfo#DeleteOnClose} set to <i>false</i> to notify the driver when the file is no longer requested to be
* deleted.
* <p>
* When you return {@link NtStatuses#STATUS_SUCCESS}, you get a {@link DokanyFileSystem#cleanup(WString, DokanFileInfo)} call afterwards with {@link DokanFileInfo#DeleteOnClose} set to <i>true</i> and only then you
* When you return {@link NtStatuses#STATUS_SUCCESS}, you get a {@link DokanFileSystem#cleanup(WString, DokanFileInfo)} call afterwards with {@link DokanFileInfo#DeleteOnClose} set to <i>true</i> and only then you
* have to actually delete the file being closed.
*
* @param rawPath
Expand Down Expand Up @@ -317,9 +317,9 @@ int unlockFile(
* Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space, the total amount of free space, and the total amount of free space available to the user that
* is associated with the calling thread.
* <p>
* Neither this method nor {@link DokanyFileSystem#getVolumeInformation(Pointer, int, IntByReference, IntByReference, IntByReference, Pointer, int, DokanFileInfo)} save the {@link DokanFileInfo#Context}. Before these
* methods are called, {@link DokanyFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)} may not be called. (ditto @{link DokanyOperations.CloseFile} and @{link
* DokanyOperations.Cleanup}).
* Neither this method nor {@link DokanFileSystem#getVolumeInformation(Pointer, int, IntByReference, IntByReference, IntByReference, Pointer, int, DokanFileInfo)} save the {@link DokanFileInfo#Context}. Before these
* methods are called, {@link DokanFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)} may not be called. (ditto @{link DokanOperations.CloseFile} and @{link
* DokanOperations.Cleanup}).
*
* @param freeBytesAvailable
* @param totalNumberOfBytes
Expand All @@ -336,13 +336,13 @@ int getDiskFreeSpace(
/**
* Retrieves information about the file system and volume associated with the specified root directory.
* <p>
* Neither this method nor {@link DokanyFileSystem#getVolumeInformation(Pointer, int, IntByReference, IntByReference, IntByReference, Pointer, int, DokanFileInfo)} save the {@link DokanFileInfo#Context}. Before these
* methods are called, {@link DokanyFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)} may not be called. (ditto @{link DokanyOperations.CloseFile} and @{link
* DokanyOperations.Cleanup}).
* Neither this method nor {@link DokanFileSystem#getVolumeInformation(Pointer, int, IntByReference, IntByReference, IntByReference, Pointer, int, DokanFileInfo)} save the {@link DokanFileInfo#Context}. Before these
* methods are called, {@link DokanFileSystem#zwCreateFile(WString, WinBase.SECURITY_ATTRIBUTES, int, int, int, int, int, DokanFileInfo)} may not be called. (ditto @{link DokanOperations.CloseFile} and @{link
* DokanOperations.Cleanup}).
* <p>
* {@link FileSystemFlag#READ_ONLY_VOLUME} is automatically added to the features if {@link MountOption#WRITE_PROTECTION} was specified during mount.
* <p>
* If {@link NtStatuses#STATUS_NOT_IMPLEMENTED} is returned, the Dokany kernel driver use following settings by default:
* If {@link NtStatuses#STATUS_NOT_IMPLEMENTED} is returned, the Dokan kernel driver use following settings by default:
*
* <ul>
* <li>rawVolumeSerialNumber = 0x19831116</li>
Expand Down Expand Up @@ -372,7 +372,7 @@ int getVolumeInformation(
DokanFileInfo dokanFileInfo);

/**
* Is called when Dokany succeeded mounting the volume.
* Is called when Dokan succeeded mounting the volume.
*
* @param dokanFileInfo {@link DokanFileInfo} with information about the file or directory.
* @return the appropriate NTSTATUS value. For an overview see {@link NtStatuses}.
Expand All @@ -381,7 +381,7 @@ int mounted(
DokanFileInfo dokanFileInfo);

/**
* Is called when Dokany succeeded unmounting the volume.
* Is called when Dokan succeeded unmounting the volume.
*
* @param dokanFileInfo {@link DokanFileInfo} with information about the file or directory.
* @return the appropriate NTSTATUS value. For an overview see {@link NtStatuses}.
Expand Down Expand Up @@ -449,7 +449,7 @@ void fillWin32FindData(
*/
int findStreams(
WString rawPath,
DokanyOperations.FillWin32FindStreamData rawFillFindData,
DokanOperations.FillWin32FindStreamData rawFillFindData,
DokanFileInfo dokanFileInfo);

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.LongByReference;

public class DokanyFileSystemStub extends AbstractDokanyFileSystem {
public class DokanFileSystemStub extends AbstractDokanFileSystem {

public DokanyFileSystemStub(FileSystemInformation fileSystemInformation, boolean usesKernelFlagsAndCodes) {
public DokanFileSystemStub(FileSystemInformation fileSystemInformation, boolean usesKernelFlagsAndCodes) {
super(fileSystemInformation, usesKernelFlagsAndCodes);
}

Expand Down Expand Up @@ -71,13 +71,13 @@ public int getFileInformation(WString fileName, ByHandleFileInformation handleFi

@Override
@NotImplemented
public int findFiles(WString rawPath, DokanyOperations.FillWin32FindData rawFillFindData, DokanFileInfo dokanFileInfo) {
public int findFiles(WString rawPath, DokanOperations.FillWin32FindData rawFillFindData, DokanFileInfo dokanFileInfo) {
return 0;
}

@Override
@NotImplemented
public int findFilesWithPattern(WString fileName, WString searchPattern, DokanyOperations.FillWin32FindData rawFillFindData, DokanFileInfo dokanFileInfo) {
public int findFilesWithPattern(WString fileName, WString searchPattern, DokanOperations.FillWin32FindData rawFillFindData, DokanFileInfo dokanFileInfo) {
return 0;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ public void fillWin32FindData(WinBase.WIN32_FIND_DATA rawFillFindData, DokanFile

@Override
@NotImplemented
public int findStreams(WString rawPath, DokanyOperations.FillWin32FindStreamData rawFillFindData, DokanFileInfo dokanFileInfo) {
public int findStreams(WString rawPath, DokanOperations.FillWin32FindStreamData rawFillFindData, DokanFileInfo dokanFileInfo) {
return 0;
}
}
6 changes: 3 additions & 3 deletions src/main/java/dev/dokan/dokan_java/DokanNativeMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public static short getMinimumRequiredDokanVersion() {
* If the mount fails, it will directly return {@link MountError}.
*
* @param options A {@link DokanOptions} object that describes the mount.
* @param operations Instance of {@link DokanyOperations} that will be called for each file system request made by the kernel.
* @param operations Instance of {@link DokanOperations} that will be called for each file system request made by the kernel.
* @return a status code indicating the outcome. For the possible values, see {@link MountError}.
*/
static native int DokanMain(DokanOptions options, DokanyOperations operations);
static native int DokanMain(DokanOptions options, DokanOperations operations);

/**
* Get the version of Dokan.
Expand Down Expand Up @@ -122,7 +122,7 @@ public static short getMinimumRequiredDokanVersion() {
static native WinNT.HANDLE DokanOpenRequestorToken(DokanFileInfo dokanFileInfo);

/**
* Convert {@link DokanyOperations.ZwCreateFile} parameters to CreateFile parameters.
* Convert {@link DokanOperations.ZwCreateFile} parameters to CreateFile parameters.
* TODO: Improve documentation
*
* @param desiredAccess
Expand Down
Loading

0 comments on commit 6c5f9c7

Please sign in to comment.