mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
implement File.getAbsoluteFile for Windows
This commit is contained in:
parent
a254d20e0e
commit
c5ef39f2bd
@ -323,7 +323,19 @@ extern "C" JNIEXPORT jstring JNICALL
|
||||
Java_java_io_File_toAbsolutePath(JNIEnv* e UNUSED, jclass, jstring path)
|
||||
{
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
// todo
|
||||
string_t chars = getChars(e, path);
|
||||
if (chars) {
|
||||
const unsigned BufferSize = MAX_PATH;
|
||||
char_t buffer[BufferSize];
|
||||
DWORD success = GetFullPathNameW(chars, BufferSize, buffer, 0);
|
||||
releaseChars(e, path, chars);
|
||||
|
||||
if (success) {
|
||||
return e->NewString
|
||||
(reinterpret_cast<const jchar*>(buffer), wcslen(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
#else
|
||||
jstring result = path;
|
||||
|
Loading…
Reference in New Issue
Block a user