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) {
|
switch (mode) {
|
||||||
case SYSTEM:
|
case SYSTEM:
|
||||||
cacheFolder = new File(Utilities.path("/var", "lib", ".fhir", "packages"));
|
if (Utilities.isWindows()) {
|
||||||
|
cacheFolder = new File(Utilities.path("C:","ProgramData", ".fhir", "packages"));
|
||||||
|
} else {
|
||||||
|
cacheFolder = new File(Utilities.path("/var", "lib", ".fhir", "packages"));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case USER:
|
case USER:
|
||||||
cacheFolder = new File(Utilities.path(System.getProperty("user.home"), ".fhir", "packages"));
|
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.Test;
|
||||||
import org.junit.jupiter.api.condition.DisabledOnOs;
|
import org.junit.jupiter.api.condition.DisabledOnOs;
|
||||||
|
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||||
import org.junit.jupiter.api.condition.OS;
|
import org.junit.jupiter.api.condition.OS;
|
||||||
|
|
||||||
public class FilesystemPackageManagerTests {
|
public class FilesystemPackageManagerTests {
|
||||||
|
@ -89,4 +90,14 @@ public class FilesystemPackageManagerTests {
|
||||||
};
|
};
|
||||||
assertEquals( "/var/lib/.fhir/packages", filesystemPackageCacheManager.getFolder());
|
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