implement a few classpath methods required by SWT for Win32

This commit is contained in:
Joel Dice
2007-10-29 14:57:33 -06:00
parent 7aecdb6ce0
commit 75d4a4ff96
5 changed files with 34 additions and 0 deletions

View File

@ -163,6 +163,21 @@ Java_java_io_File_delete(JNIEnv* e, jclass, jstring path)
return r == 0;
}
extern "C" JNIEXPORT jboolean JNICALL
Java_java_io_File_isDirectory(JNIEnv* e, jclass, jstring path)
{
const char* chars = e->GetStringUTFChars(path, 0);
if (chars) {
STRUCT_STAT s;
int r = STAT(chars, &s);
bool v = (r == 0 and S_ISDIR(s.st_mode));
e->ReleaseStringUTFChars(path, chars);
return v;
} else {
return false;
}
}
extern "C" JNIEXPORT jboolean JNICALL
Java_java_io_File_exists(JNIEnv* e, jclass, jstring path)
{