Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sentinel
Commits
99f3cc67
Commit
99f3cc67
authored
May 21, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
143c4c75
Pipeline
#119
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
23 deletions
+12
-23
LinuxConnect.java
src/main/java/com/egolm/sentinel/util/LinuxConnect.java
+12
-22
HttpController.java
src/main/java/com/egolm/sentinel/web/HttpController.java
+0
-1
No files found.
src/main/java/com/egolm/sentinel/util/LinuxConnect.java
View file @
99f3cc67
...
...
@@ -17,32 +17,22 @@ public class LinuxConnect {
}
}
public
Boolean
login
(
String
username
,
String
password
)
{
try
{
connection
.
connect
();
boolean
isLoginSuccess
=
connection
.
authenticateWithPassword
(
username
,
password
);
if
(!
isLoginSuccess
)
{
connection
.
close
();
}
return
isLoginSuccess
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
public
Boolean
login
(
String
username
,
String
password
)
throws
IOException
{
connection
.
connect
();
boolean
isLoginSuccess
=
connection
.
authenticateWithPassword
(
username
,
password
);
if
(!
isLoginSuccess
)
{
connection
.
close
();
}
return
isLoginSuccess
;
}
public
Boolean
loginByFileKey
(
String
username
,
String
publicKey
,
String
keyPassword
)
{
try
{
connection
.
connect
();
boolean
isLoginSuccess
=
connection
.
authenticateWithPublicKey
(
username
,
publicKey
.
toCharArray
(),
keyPassword
);
if
(!
isLoginSuccess
)
{
connection
.
close
();
}
return
isLoginSuccess
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
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
;
}
public
void
close
()
{
...
...
src/main/java/com/egolm/sentinel/web/HttpController.java
View file @
99f3cc67
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment