Skip to content

Commit

Permalink
BLADE-738 cli: BladeUtil: removes unused fields and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbrokke committed Nov 14, 2023
1 parent 0a54e42 commit 3de6c56
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions cli/src/main/java/com/liferay/blade/cli/util/BladeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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<String, Object> _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);

Expand Down

0 comments on commit 3de6c56

Please sign in to comment.