Path fix for Windows
This commit is contained in:
parent
e9b1e63e04
commit
eb81b0abb4
|
@ -146,7 +146,11 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
|
|||
|
||||
switch (mode) {
|
||||
case SYSTEM:
|
||||
if (Utilities.isWindows()) {
|
||||
cacheFolder = new File(Utilities.path("C:","ProgramData", ".fhir", "packages"));
|
||||
} else {
|
||||
cacheFolder = new File(Utilities.path("/var", "lib", ".fhir", "packages"));
|
||||
}
|
||||
break;
|
||||
case USER:
|
||||
cacheFolder = new File(Utilities.path(System.getProperty("user.home"), ".fhir", "packages"));
|
||||
|
|
|
@ -10,6 +10,7 @@ import javax.annotation.Nonnull;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.DisabledOnOs;
|
||||
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
|
||||
public class FilesystemPackageManagerTests {
|
||||
|
@ -89,4 +90,14 @@ public class FilesystemPackageManagerTests {
|
|||
};
|
||||
assertEquals( "/var/lib/.fhir/packages", filesystemPackageCacheManager.getFolder());
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnabledOnOs(OS.WINDOWS)
|
||||
public void testSystemCacheDirectoryWin() throws IOException {
|
||||
FilesystemPackageCacheManager filesystemPackageCacheManager = new FilesystemPackageCacheManager(false) {
|
||||
protected void initCacheFolder() throws IOException {
|
||||
}
|
||||
};
|
||||
assertEquals( "C:\\ProgramData\\.fhir\\packages", filesystemPackageCacheManager.getFolder());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue