diff --git a/network/tor/tor/src/main/java/bisq/tor/OsType.java b/network/tor/tor/src/main/java/bisq/tor/OsType.java deleted file mode 100644 index a35774bd16..0000000000 --- a/network/tor/tor/src/main/java/bisq/tor/OsType.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of Bisq. - * - * Bisq is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bisq is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bisq. If not, see . - */ - -package bisq.tor; - -import bisq.common.util.OsUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static bisq.common.util.FileUtils.FILE_SEP; -import static bisq.tor.Constants.*; - -public enum OsType { - WIN, - LINUX_32, - LINUX_64, - OSX; - - private static final Logger log = LoggerFactory.getLogger(OsType.class); - - public static OsType getOsType() { - if (OsUtils.isWindows()) { - return WIN; - } else if (OsUtils.isMac()) { - return OSX; - } else if (OsUtils.isLinux32()) { - return LINUX_32; - } else if (OsUtils.isLinux64()) { - return LINUX_64; - } else { - throw new RuntimeException("Not supported OS: " + OsUtils.getOSName() + " / " + OsUtils.getOSArchitecture()); - } - } - - public String getArchiveName() { - return FILE_SEP + NATIVE_DIR + FILE_SEP + getOsDir() + FILE_SEP + TOR_ARCHIVE; - } - - public String getTorrcNative() { - return FILE_SEP + getOsDir(false) + FILE_SEP + TORRC_NATIVE; - } - - private String getOsDir() { - return getOsDir(true); - } - - private String getOsDir(boolean distinctArch) { - switch (this) { - case WIN: - return WIN_DIR; - case LINUX_32: - return distinctArch ? LINUX32_DIR : LINUX_DIR; - case LINUX_64: - return distinctArch ? LINUX64_DIR : LINUX_DIR; - case OSX: - return distinctArch ? OSX_DIR_64 : OSX_DIR; - default: - throw new RuntimeException("Not supported OS " + this); - } - } -} diff --git a/network/tor/tor/src/main/java/bisq/tor/installer/TorBinaryZipExtractor.java b/network/tor/tor/src/main/java/bisq/tor/installer/TorBinaryZipExtractor.java index 774e032bc3..effa48ddf8 100644 --- a/network/tor/tor/src/main/java/bisq/tor/installer/TorBinaryZipExtractor.java +++ b/network/tor/tor/src/main/java/bisq/tor/installer/TorBinaryZipExtractor.java @@ -19,7 +19,7 @@ import bisq.common.archive.ZipFileExtractionFailedException; import bisq.common.archive.ZipFileExtractor; -import bisq.tor.OsType; +import bisq.common.util.OsUtils; import lombok.extern.slf4j.Slf4j; import java.io.File; @@ -67,12 +67,6 @@ private void makeTorBinaryExecutable() { } private boolean isMacOsOrLinux() { - switch (OsType.getOsType()) { - case OSX: - case LINUX_32: - case LINUX_64: - return true; - } - return false; + return OsUtils.isMac() || OsUtils.isLinux(); } }