Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
5c4d0e46
Commit
5c4d0e46
authored
May 08, 2020
by
zhanghouying
Committed by
ZhengJie
May 08, 2020
Browse files
[Bug修复](v2.5): v2.5 beta 解决不能向不同服务器部署应用的缺陷
Closes #347
parent
8b7a1ab6
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java
View file @
5c4d0e46
...
...
@@ -17,8 +17,10 @@ package me.zhengjie.modules.mnt.util;
import
ch.ethz.ssh2.Connection
;
import
ch.ethz.ssh2.SCPClient
;
import
com.google.common.collect.Maps
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
...
...
@@ -29,20 +31,20 @@ import java.util.logging.Logger;
*/
public
class
ScpClientUtil
{
static
private
ScpClientUtil
instance
;
static
private
Map
<
String
,
ScpClientUtil
>
instance
=
Maps
.
newHashMap
()
;
static
synchronized
public
ScpClientUtil
getInstance
(
String
ip
,
int
port
,
String
username
,
String
passw
a
rd
)
{
if
(
instance
==
null
)
{
instance
=
new
ScpClientUtil
(
ip
,
port
,
username
,
passw
a
rd
);
static
synchronized
public
ScpClientUtil
getInstance
(
String
ip
,
int
port
,
String
username
,
String
passw
o
rd
)
{
if
(
instance
.
get
(
ip
)
==
null
)
{
instance
.
put
(
ip
,
new
ScpClientUtil
(
ip
,
port
,
username
,
passw
o
rd
)
)
;
}
return
instance
;
return
instance
.
get
(
ip
)
;
}
public
ScpClientUtil
(
String
ip
,
int
port
,
String
username
,
String
passw
a
rd
)
{
public
ScpClientUtil
(
String
ip
,
int
port
,
String
username
,
String
passw
o
rd
)
{
this
.
ip
=
ip
;
this
.
port
=
port
;
this
.
username
=
username
;
this
.
password
=
passw
a
rd
;
this
.
password
=
passw
o
rd
;
}
public
void
getFile
(
String
remoteFile
,
String
localTargetDirectory
)
{
...
...
Write
Preview
Supports
Markdown
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