Commit 99f3cc67 authored by Quxl's avatar Quxl

x

parent 143c4c75
Pipeline #119 canceled with stages
......@@ -17,32 +17,22 @@ public class LinuxConnect {
}
}
public Boolean login(String username, String password) {
try {
public Boolean login(String username, String password) throws IOException {
connection.connect();
boolean isLoginSuccess = connection.authenticateWithPassword(username, password);
if (!isLoginSuccess) {
connection.close();
}
return isLoginSuccess;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public Boolean loginByFileKey(String username, String publicKey, String keyPassword) {
try {
public Boolean loginByFileKey(String username, String publicKey, String keyPassword) throws IOException {
connection.connect();
boolean isLoginSuccess = connection.authenticateWithPublicKey(username, publicKey.toCharArray(), keyPassword);
if (!isLoginSuccess) {
connection.close();
}
return isLoginSuccess;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public void close() {
......
......@@ -164,7 +164,6 @@ public class HttpController {
} catch (XRException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
throw new XRException(e.getMessage(), e);
} finally {
connect.close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment