Skip to content

Commit

Permalink
Added parameters requested by movirt team.
Browse files Browse the repository at this point in the history
  • Loading branch information
iiordanov committed Jul 5, 2015
1 parent 53db227 commit 607be80
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions eclipse_projects/bVNC/src/com/iiordanov/bVNC/ConnectionBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,27 @@ void parseFromUri(Uri dataUri) {
saveConnection = Boolean.parseBoolean(saveConnectionParam); // throw if invalid
}

// Parse a passed-in TLS port number.
String tlsPortParam = dataUri.getQueryParameter(Constants.PARAM_TLS_PORT);
if (tlsPortParam != null) {
int tlsPort = Integer.parseInt(tlsPortParam);
if (!isValidPort(tlsPort))
throw new IllegalArgumentException("The specified TLS port is not valid.");
setTlsPort(tlsPort);
}

// Parse a CA Cert path parameter
String caCertPath = dataUri.getQueryParameter(Constants.PARAM_CACERT_PATH);
if (caCertPath != null) {
setCaCertPath(caCertPath);
}

// Parse a Cert subject
String certSubject = dataUri.getQueryParameter(Constants.PARAM_CERT_SUBJECT);
if (certSubject != null) {
setCertSubject(certSubject);
}

// if we are going to save the connection, we will do so here
// it may make sense to confirm overwriting data but is probably unnecessary
if (saveConnection) {
Expand Down
3 changes: 3 additions & 0 deletions eclipse_projects/bVNC/src/com/iiordanov/bVNC/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class Constants {
public static final String PARAM_COLORMODEL = "ColorModel";
public static final String PARAM_SAVE_CONN = "SaveConnection";
public static final String PARAM_APIKEY = "ApiKey";
public static final String PARAM_TLS_PORT = "TlsPort";
public static final String PARAM_CACERT_PATH = "CaCertPath";
public static final String PARAM_CERT_SUBJECT = "CertSubject";

public static final int SECTYPE_NONE = 1;
public static final int SECTYPE_VNC = 2;
Expand Down

0 comments on commit 607be80

Please sign in to comment.