public class WindowsDirectory extends FSDirectory
Directory
implementation for Microsoft Windows.
Steps:
c:\mingw\bin\g++ -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -I"%JAVA_HOME%\include" -I"%JAVA_HOME%\include\win32" -static-libgcc -static-libstdc++ -shared WindowsDirectory.cpp -o WindowsDirectory.dllFor 64-bit JREs, use mingw64, with the -m64 option.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
WindowsDirectory.WindowsIndexInput |
FSDirectory.FSIndexOutput
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_BUFFERSIZE |
directory
isOpen, lockFactory
Constructor and Description |
---|
WindowsDirectory(java.nio.file.Path path)
Create a new WindowsDirectory for the named location and
FSLockFactory.getDefault() . |
WindowsDirectory(java.nio.file.Path path,
LockFactory lockFactory)
Create a new WindowsDirectory for the named location.
|
Modifier and Type | Method and Description |
---|---|
private static void |
close(long fd)
Closes a handle to a file
|
private static long |
length(long fd)
Returns the length of a file
|
private static long |
open(java.lang.String filename)
Opens a handle to a file.
|
IndexInput |
openInput(java.lang.String name,
IOContext context)
Returns a stream reading an existing file.
|
private static int |
read(long fd,
byte[] bytes,
int offset,
int length,
long pos)
Reads data from a file at pos into bytes
|
checkPendingDeletions, close, createOutput, createTempOutput, deleteFile, deletePendingFiles, ensureCanRead, fileLength, fsync, getDirectory, listAll, listAll, open, open, renameFile, sync, toString
ensureOpen, obtainLock
copyFrom, openChecksumInput
private static final int DEFAULT_BUFFERSIZE
public WindowsDirectory(java.nio.file.Path path, LockFactory lockFactory) throws java.io.IOException
path
- the path of the directorylockFactory
- the lock factory to usejava.io.IOException
- If there is a low-level I/O errorpublic WindowsDirectory(java.nio.file.Path path) throws java.io.IOException
FSLockFactory.getDefault()
.path
- the path of the directoryjava.io.IOException
- If there is a low-level I/O errorpublic IndexInput openInput(java.lang.String name, IOContext context) throws java.io.IOException
Directory
Throws FileNotFoundException
or NoSuchFileException
if the file does not exist.
private static long open(java.lang.String filename) throws java.io.IOException
java.io.IOException
private static int read(long fd, byte[] bytes, int offset, int length, long pos) throws java.io.IOException
java.io.IOException
private static void close(long fd) throws java.io.IOException
java.io.IOException
private static long length(long fd) throws java.io.IOException
java.io.IOException