Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to import ChannelSftp.LsEntry from Jsch when I use it in Scala code, why?

Tags:

scala

sftp

jsch

So in my scala class, I had to use the Jsch(JAVA) library to do SFTP work. But for some reason, it is unable to import:

import com.jcraft.jsch.ChannelSftp.LsEntry

Any idea why this would be? LsEntry is a nested class of ChannelSftp.

http://epaul.github.io/jsch-documentation/simple.javadoc/com/jcraft/jsch/ChannelSftp.html

package services.impl

import java.nio.file.Path

import com.jcraft.jsch.ChannelSftp
import com.jcraft.jsch.ChannelSftp.LsEntry
import services.InputService

class InputServiceImpl extends InputService[List[ChannelSftp.LsEntry]] {

}
like image 403
iCodeLikeImDrunk Avatar asked Aug 07 '15 13:08

iCodeLikeImDrunk


People also ask

What is ChannelSftp LsEntry?

public class ChannelSftp.LsEntry extends Object implements Comparable. Represents a directory entry, representing a remote file or directory. A vector of objects of this inner class is returned by ChannelSftp.ls(java. lang. String) .

What is ChannelSftp?

public class ChannelSftp extends Channel. A Channel connected to an sftp server (as a subsystem of the ssh server). This class supports the client side of the sftp protocol, version 3, and implements an interface similar to the usual sftp command line client.


1 Answers

Figured it out.

In scala, to reference an nested class, you use the following syntax:

ChannelSftp#LsEntry
like image 109
iCodeLikeImDrunk Avatar answered Oct 05 '22 11:10

iCodeLikeImDrunk