symbolic links support

This commit is contained in:
Dmitry Avdeev
2010-03-22 12:49:06 +03:00
parent 6431e9d670
commit 5189bc24c7
6 changed files with 20 additions and 9 deletions
Binary file not shown.
+9
View File
@@ -72,6 +72,15 @@ JNIEXPORT jobject JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_get
return CreateFileInfo(env, &data, infoClass);
}
JNIEXPORT jboolean JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_checkExist(JNIEnv *env, jobject method, jstring path) {
jint result = 0;
WIN32_FILE_ATTRIBUTE_DATA wfad;
const jchar* str = env->GetStringChars(path, 0);
if (GetFileAttributesEx((LPCWSTR)path, GetFileExInfoStandard, &wfad)) return JNI_TRUE;
return JNI_FALSE;
}
JNIEXPORT jobjectArray JNICALL Java_com_intellij_openapi_vfs_impl_win32_IdeaWin32_listChildren(JNIEnv *env, jobject method, jstring path)
{
+6 -7
View File
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="9.00"
Name="IdeaWin32"
ProjectGUID="{D1A0CC4B-C100-46E4-918A-958626AE1ACF}"
RootNamespace="IdeaWin32"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -64,6 +65,8 @@
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -84,9 +87,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@@ -139,6 +139,8 @@
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -159,9 +161,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@@ -22,5 +22,7 @@ public class IdeaWin32 {
public native FileInfo getInfo(String path);
public native boolean checkExist(String path);
public native FileInfo[] listChildren(String path);
}
@@ -67,7 +67,7 @@ public class Win32Kernel {
return true;
}
catch (FileNotFoundException e) {
return false;
return myKernel.checkExist(path);
}
}
@@ -56,13 +56,14 @@ public class Win32LocalFileSystem extends LocalFileSystemBase {
};
public static Win32LocalFileSystem getWin32Instance() {
if (!isAvailable()) throw new RuntimeException("dll is not loaded");
Win32LocalFileSystem fileSystem = THREAD_LOCAL.get();
fileSystem.myKernel.clearCache();
return fileSystem;
}
private final Win32Kernel myKernel = new Win32Kernel();
private boolean checkMe = false;
public static boolean checkMe = false;
private Win32LocalFileSystem() {
}