[
https://issues.apache.org/jira/browse/SSHD-1086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17200689#comment-17200689
]
Netram commented on SSHD-1086:
------------------------------
doWithSftpClient((sftpClient) -> {
*for* (String remotePath : remotePaths) {
*try* {
String fullPath = FilenameUtils._getFullPath_(remotePath);
String extention = FilenameUtils._getExtension_(remotePath);
String fullPathNoEndSeparator = FilenameUtils
._getFullPathNoEndSeparator_(remotePath);
String name = FilenameUtils._getName_(remotePath);
DirectoryScanner ds = *new* DirectoryScanner();
String[] include = \{ name };//Test.txt
ds.setIncludes(include);
// ds.setBasedir(canonicalRemotePath);
// ds.setBasedir(new File(canonicalRemotePath));
ds.setBasedir(*new* File(fullPathNoEndSeparator));
ds.scan();
System.*_out_*.println("FILES:");
String[] files = ds.getIncludedFiles();
*for* (*int* i = 0; i < files.length; i++) {
System.*_out_*.println(files[i]);
sftpClient.remove(files[i]);
}
# *Throwing error from ds.scan() method*
2020-09-22 21:16:01 INFO AbstractJobManager:728 - (text.txt | text.txt) :
Stream failed due to unexpected error.
+java.lang.IllegalStateException+: basedir \home\ns\log* does not exist
at
org.apache.sshd.common.util.io.DirectoryScanner.scan(+DirectoryScanner.java:223+)
~[sshd-common-2.1.0.jar:2.1.0]
> Base dir doesn’t exist issue
> ----------------------------
>
> Key: SSHD-1086
> URL: https://issues.apache.org/jira/browse/SSHD-1086
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.1.0
> Reporter: Netram
> Priority: Major
> Attachments: 309002D7-B870-410D-B4A0-A1683166298A.jpeg
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> I am getting base dir doesn’t exist error message.
> This error is throwing from ds.scan() method.
> This is working in local env not working in remote server.
> Please see the attached code.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]