throw new Exception(xlocalStrings.getLocalString(
"enterprise.deployapi.spi.invaliduri", // NOI18N
"Invalid URI")); // NOI18N
}
ServerConnectionIdentifier sci = new ServerConnectionIdentifier();
if(uri.length() == targetURI.length()) {
sci.setHostName(LOCAL_HOST);
sci.setHostPort(HOST_PORT);
} else {
String reminder = uri.substring(targetURI.length());
String[] splitted = reminder.split(URI_SEPARATOR);
if (splitted.length<2) {
throw new Exception(xlocalStrings.getLocalString(
"enterprise.deployapi.spi.invaliduri", // NOI18N
"Invalid URI")); // NOI18N
}
if ("".equals(splitted[0])) {
sci.setHostName(LOCAL_HOST);
} else {
sci.setHostName(splitted[0]);
}
if ("".equals(splitted[1])) {
sci.setHostPort(HOST_PORT);
} else {
sci.setHostPort(Integer.parseInt(splitted[1]));
}
if (splitted.length>2) {
if (HTTPS.equals(splitted[2])) {
sci.setSecure(true);
}
}
}
return sci;
}