From 497a9dbaeaf953248fcb67d26196ddf7deabc8d8 Mon Sep 17 00:00:00 2001 From: farfromrefuge Date: Mon, 7 Nov 2022 02:17:42 +0000 Subject: [PATCH] fix(android): file system normalizePath (#10077) --- packages/core/file-system/file-system-access.android.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/file-system/file-system-access.android.ts b/packages/core/file-system/file-system-access.android.ts index d0eed3c0e..68c43b05c 100644 --- a/packages/core/file-system/file-system-access.android.ts +++ b/packages/core/file-system/file-system-access.android.ts @@ -581,9 +581,9 @@ export class FileSystemAccess implements IFileSystemAccess { } public normalizePath(path: string): string { - const file = new java.io.File(path); - - return file.getAbsolutePath(); + // the [''] is a trick to not have to create a android.net.URI + // and use the method with string signature + return java.nio.file.Paths.get(path, ['']).normalize().toString(); } public joinPath(left: string, right: string): string {