Skip to content
Snippets Groups Projects
Commit a639076d authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

remove quotation for filename passed to ScpClient

parent aae28174
No related branches found
No related tags found
No related merge requests found
...@@ -59,8 +59,7 @@ class HaaSFileTransferImp implements HaaSFileTransfer { ...@@ -59,8 +59,7 @@ class HaaSFileTransferImp implements HaaSFileTransfer {
try { try {
fileName = fileName.replaceFirst("/", ""); fileName = fileName.replaceFirst("/", "");
final Path rFile = workDirectory.resolve(fileName); final Path rFile = workDirectory.resolve(fileName);
final String fileToDownload = "'" + ft.getSharedBasepath() + "/" + final String fileToDownload = ft.getSharedBasepath() + "/" + fileName;
fileName + "'";
scpClient.download(fileToDownload, rFile, progress); scpClient.download(fileToDownload, rFile, progress);
} }
catch (JSchException | IOException e) { catch (JSchException | IOException e) {
...@@ -78,7 +77,8 @@ class HaaSFileTransferImp implements HaaSFileTransfer { ...@@ -78,7 +77,8 @@ class HaaSFileTransferImp implements HaaSFileTransfer {
public List<Long> obtainSize(List<String> files) throws InterruptedIOException { public List<Long> obtainSize(List<String> files) throws InterruptedIOException {
try { try {
return getSizes(files.stream() return getSizes(files.stream()
.map(filename -> "'" + ft.getSharedBasepath() + "/" + filename + "'").collect(Collectors.toList())); .map(filename -> ft.getSharedBasepath() + "/" + filename).collect(
Collectors.toList()));
} catch (InterruptedIOException e) { } catch (InterruptedIOException e) {
throw e; throw e;
} catch (JSchException | IOException e) { } catch (JSchException | IOException e) {
...@@ -95,7 +95,7 @@ class HaaSFileTransferImp implements HaaSFileTransfer { ...@@ -95,7 +95,7 @@ class HaaSFileTransferImp implements HaaSFileTransfer {
for (String fileName : files) { for (String fileName : files) {
fileName = replaceIfFirstFirst(fileName); fileName = replaceIfFirstFirst(fileName);
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
String fileToDownload = "'" + ft.getSharedBasepath() + "/" + fileName + "'"; String fileToDownload = ft.getSharedBasepath() + "/" + fileName;
scpClient.download(fileToDownload, os, progress); scpClient.download(fileToDownload, os, progress);
os.flush(); os.flush();
result.add(os.toString()); result.add(os.toString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment