Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 51645df

Browse files
ThePrezsoc
authored andcommitted
Add IBM i as supported platform
1 parent d0bcea1 commit 51645df

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/main/java/dev/dirs/BaseDirectories.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ private BaseDirectories() {
251251
case LIN:
252252
case BSD:
253253
case SOLARIS:
254+
case IBMI:
254255
homeDir = System.getProperty("user.home");
255256
cacheDir = defaultIfNullOrEmpty(System.getenv("XDG_CACHE_HOME"), homeDir, "/.cache");
256257
configDir = defaultIfNullOrEmpty(System.getenv("XDG_CONFIG_HOME"), homeDir, "/.config");

src/main/java/dev/dirs/ProjectDirectories.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ public static ProjectDirectories fromPath(String path) {
234234
case LIN:
235235
case BSD:
236236
case SOLARIS:
237+
case IBMI:
237238
homeDir = System.getProperty("user.home");
238239
cacheDir = defaultIfNullOrEmptyExtended(System.getenv("XDG_CACHE_HOME"), path, homeDir + "/.cache/", path);
239240
configDir = defaultIfNullOrEmptyExtended(System.getenv("XDG_CONFIG_HOME"), path, homeDir + "/.config/", path);

src/main/java/dev/dirs/UserDirectories.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,18 @@ private UserDirectories() {
327327
templateDir = null;
328328
videoDir = homeDir + "/Movies";
329329
break;
330+
case IBMI:
331+
homeDir = System.getProperty("user.home");
332+
audioDir = homeDir + "/Music";
333+
desktopDir = homeDir + "/Desktop";
334+
documentDir = homeDir + "/Documents";
335+
downloadDir = homeDir + "/Downloads";
336+
fontDir = defaultIfNullOrEmptyExtended(System.getenv("XDG_DATA_HOME"), "/fonts", homeDir, "/.local/share/fonts");
337+
pictureDir = homeDir + "/Pictures";
338+
publicDir = homeDir + "/Public";
339+
templateDir = null;
340+
videoDir = homeDir + "/Movies";
341+
break;
330342
case WIN:
331343
String[] winDirs = getWinDirs(
332344
"5E6C858F-0E22-4760-9AFE-EA3317B67173",

src/main/java/dev/dirs/Util.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ private Util() {
2222
static final char WIN = 'w';
2323
static final char BSD = 'b';
2424
static final char SOLARIS = 's';
25+
static final char IBMI = 'i';
2526

2627
static final String UTF8_BOM = "\ufeff";
2728

@@ -37,6 +38,8 @@ else if (os.contains("bsd"))
3738
operatingSystem = BSD;
3839
else if (os.contains("sunos"))
3940
operatingSystem = SOLARIS;
41+
else if (os.contains("os/400") || os.contains("os400"))
42+
operatingSystem = IBMI;
4043
else
4144
throw new UnsupportedOperatingSystemException("directories are not supported on " + operatingSystemName);
4245
}

0 commit comments

Comments
 (0)