From 0247b5c7767e0fa846e81f4afe40f0b4edb325e8 Mon Sep 17 00:00:00 2001 From: drewbrokke Date: Fri, 10 Nov 2023 13:19:00 -0600 Subject: [PATCH] BLADE-738 cli: BladeUtil: removes unused fields and methods --- .../com/liferay/blade/cli/util/BladeUtil.java | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/util/BladeUtil.java b/cli/src/main/java/com/liferay/blade/cli/util/BladeUtil.java index 481102fa6..2189483f6 100644 --- a/cli/src/main/java/com/liferay/blade/cli/util/BladeUtil.java +++ b/cli/src/main/java/com/liferay/blade/cli/util/BladeUtil.java @@ -86,8 +86,6 @@ import org.gradle.internal.impldep.com.google.common.base.Strings; -import org.osgi.framework.Version; - /** * @author Gregory Amerson * @author David Truong @@ -116,34 +114,6 @@ public static boolean canConnect(String host, int port) { return _canConnect(localAddress, remoteAddress); } - public static int compareVersions(Version v1, Version v2) { - if (v2 == v1) { - return 0; - } - - int result = v1.getMajor() - v2.getMajor(); - - if (result != 0) { - return result; - } - - result = v1.getMinor() - v2.getMinor(); - - if (result != 0) { - return result; - } - - result = v1.getMicro() - v2.getMicro(); - - if (result != 0) { - return result; - } - - String s1 = v1.getQualifier(); - - return s1.compareTo(v2.getQualifier()); - } - public static Path downloadFile(String urlString, Path cacheDirPath, String targetFileName) throws Exception { URL downladURL = new URL(urlString); @@ -748,18 +718,6 @@ public static void tail(Path path, PrintStream printStream) throws IOException { } } - public static boolean verifyCommerceWorkspaceProduct(String product) { - Matcher matcher = _productCommerceVersionPattern.matcher(product); - - return matcher.matches(); - } - - public static boolean verifyPortalDxpWorkspaceProduct(String product) { - Matcher matcher = _productPortalDXPVersionPattern.matcher(product); - - return matcher.matches(); - } - public static void writePropertyValue(File propertyFile, String key, String value) throws Exception { String property = System.lineSeparator() + key + "=" + value; @@ -903,12 +861,7 @@ private static Path _downloadFile( private static final String _PRODUCT_INFO_URL = "https://releases.liferay.com/tools/workspace/.product_info.json"; private static final Pattern _microPattern = Pattern.compile("((([efs])p)|(ga)|(u))([0-9]+)(-[0-9]+)?"); - private static final Pattern _productCommerceVersionPattern = Pattern.compile( - "^(commerce)-([1-9]\\d|[0-9])\\.([0-9]\\d|\\d).([0-9]\\d|\\d)(-(([1-9]\\d|[0-9])\\.([1-9]\\d|[0-9])$)+)*"); private static Map _productInfoMap = Collections.emptyMap(); - private static final Pattern _productPortalDXPVersionPattern = Pattern.compile( - "^(portal|dxp)-((([1-9]\\d|[0-9])\\.([0-9]\\d|\\d))-(((([efsd])([pe]))|u|ga)([0-9]\\d*)$)+)|" + - "((\\d{4})\\.([qQ]\\d)\\.\\d)"); private static final File _workspaceCacheDir = new File( System.getProperty("user.home"), _DEFAULT_WORKSPACE_CACHE_DIR_NAME);