From 0c5642eeac01cc3532d46e02d4901c58a9261961 Mon Sep 17 00:00:00 2001 From: Clint Valentine Date: Mon, 25 Dec 2023 13:14:53 -0500 Subject: [PATCH] Add support from reading from jimfs in-memory FS (#60) --- .../io/github/cdimascio/dotenv/internal/DotenvReader.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/cdimascio/dotenv/internal/DotenvReader.java b/src/main/java/io/github/cdimascio/dotenv/internal/DotenvReader.java index 43bfce5..016a91c 100644 --- a/src/main/java/io/github/cdimascio/dotenv/internal/DotenvReader.java +++ b/src/main/java/io/github/cdimascio/dotenv/internal/DotenvReader.java @@ -42,9 +42,11 @@ public List read() throws DotenvException, IOException { String location = dir + "/" + filename; String lowerLocation = location.toLowerCase(); - Path path = lowerLocation.startsWith("file:") || lowerLocation.startsWith("android.resource:") - ? Paths.get(URI.create(location)) - : Paths.get(location); + Path path = ( + lowerLocation.startsWith("file:") + || lowerLocation.startsWith("android.resource:") + || lowerLocation.startsWith("jimfs:") + ) ? Paths.get(URI.create(location)) : Paths.get(location); if (Files.exists(path)) { return Files.readAllLines(path);