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 07dab9e16..a749b28d5 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 @@ -85,8 +85,6 @@ import org.gradle.internal.impldep.com.google.common.base.Strings; -import org.osgi.framework.Version; - /** * @author Gregory Amerson * @author David Truong @@ -115,34 +113,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); @@ -747,18 +717,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; @@ -902,12 +860,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);