public RemoteLibrary(String key, String host, int port) {
int index = -1;
if (key != null) {
- key.indexOf('|');
+ index = key.indexOf('|');
}
if (index >= 0) {
- this.key = key.substring(index + 1);
- this.subkey = key.substring(0, index);
+ this.key = key.substring(0, index);
+ this.subkey = key.substring(index + 1);
} else {
this.key = key;
this.subkey = "";
@Override
protected void onError(Exception e) {
- // if (e instanceof SSLException) {
- result[0] = Status.UNAUTHORIZED;
- // } else {
- // result[0] = Status.UNAVAILABLE;
- // }
+ if (e instanceof SSLException) {
+ result[0] = Status.UNAUTHORIZED;
+ } else {
+ result[0] = Status.UNAVAILABLE;
+ }
}
}.connect();
} catch (UnknownHostException e) {