SftpServer: quick fix for spaces in filename
This commit is contained in:
parent
84e14a890f
commit
7a6e97a774
@ -28,6 +28,8 @@ public class SftpServer implements Server {
|
||||
|
||||
public URI upload (String name, ByteSource source) {
|
||||
try {
|
||||
final URI target = URI.create(uri.toString() + "/" + name.replace(" ", "%20"));
|
||||
|
||||
final JSch jsch = new JSch();
|
||||
final Session session = jsch.getSession(username, host, port);
|
||||
session.setPassword(password);
|
||||
@ -45,7 +47,7 @@ public class SftpServer implements Server {
|
||||
}
|
||||
|
||||
session.disconnect();
|
||||
return URI.create(uri.toString() + "/" + name);
|
||||
return target;
|
||||
} catch (final JSchException | IOException | SftpException exception) {
|
||||
throw new RuntimeException(exception);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user