| 383 | } |
| 384 | |
| 385 | extern "C" JNIEXPORT void JNICALL |
| 386 | Java_java_io_File_delete(JNIEnv* e, jclass, jstring path) |
| 387 | { |
| 388 | string_t chars = getChars(e, path); |
| 389 | int r; |
| 390 | if (chars) { |
| 391 | #ifdef PLATFORM_WINDOWS |
| 392 | if (GetFileAttributes(chars) & FILE_ATTRIBUTE_DIRECTORY) { |
| 393 | r = !RemoveDirectory(chars); |
| 394 | } else { |
| 395 | r = REMOVE(chars); |
| 396 | } |
| 397 | #else |
| 398 | r = REMOVE(chars); |
| 399 | #endif |
| 400 | if (r != 0) { |
| 401 | throwNewErrno(e, "java/io/IOException"); |
| 402 | } |
| 403 | releaseChars(e, path, chars); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | extern "C" JNIEXPORT jboolean JNICALL |
| 408 | Java_java_io_File_canRead(JNIEnv* e, jclass, jstring path) |
nothing calls this directly
no test coverage detected