Skip to content

Commit

Permalink
add OsType.UNSUPPORTED
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroleak committed Jul 4, 2019
1 parent 18e3c53 commit b544d16
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.util.Scanner;

public class OsData {
public enum OsType {WINDOWS, LINUX_32, LINUX_64, MAC, ANDROID}
public enum OsType {WINDOWS, LINUX_32, LINUX_64, MAC, ANDROID, UNSUPPORTED}
private static OsType detectedType = null;

public static OsType getOsType() {
Expand Down Expand Up @@ -62,7 +62,7 @@ protected static OsType actualGetOsType() {
} else if (osName.contains("Linux")) {
return getLinuxType();
}
throw new RuntimeException("Unsupported OS");
return OsType.UNSUPPORTED;
}

protected static OsType getLinuxType() {
Expand Down Expand Up @@ -90,7 +90,7 @@ protected static OsType getLinuxType() {
if (unameOutput.compareTo("x86_64") == 0) {
return OsType.LINUX_64;
}
throw new RuntimeException("Could not understand uname output, not sure what bitness");
return OsType.UNSUPPORTED;
} catch (IOException e) {
throw new RuntimeException("Uname failure", e);
} catch (InterruptedException e) {
Expand Down

0 comments on commit b544d16

Please sign in to comment.