zed.deployer.util.FatJarUriUtil Maven / Gradle / Ivy
package zed.deployer.util;
import java.util.regex.Matcher;
public class FatJarUriUtil extends AbstractUriUtil {
private static final String SSH_HOST = "ssh-host=";
private static final String SSH_PORT = "ssh-port=";
private static final String SSH_USER = "ssh-user=";
private static final String SSH_PASSWORD = "ssh-password=";
public static Boolean isSshUri(String uri) {
return sshHost(uri) != null &&
sshPassword(uri) != null &&
sshPassword(uri) != null;
}
public static String sshHost(String uri) {
Matcher matcher = optionsWithPrefix(SSH_HOST, uri);
if (!matcher.find()) {
return null;
}
return matcher.group(1);
}
public static Integer sshPort(String uri) {
Matcher matcher = optionsWithPrefix(SSH_PORT, uri);
if (!matcher.find()) {
return null;
}
return Integer.valueOf(matcher.group(1));
}
public static String sshUser(String uri) {
Matcher matcher = optionsWithPrefix(SSH_USER, uri);
if (!matcher.find()) {
return null;
}
return matcher.group(1);
}
public static String sshPassword(String uri) {
Matcher matcher = optionsWithPrefix(SSH_PASSWORD, uri);
if (!matcher.find()) {
return null;
}
return matcher.group(1);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy