Forum Discussion
- TanyaYatskovskaSmartBear Alumni (Retired)
Hi Markgholland,
Could you please clarify if you want to read files from your network location or from the Internet?
- markghollandOccasional Contributor
It's a network location.
I've tried the following and it appears that I can connect to the drive(getPath() for example), but for some reason I can't call certain methods(isFile() for example):
import jcifs.smb.NtlmPasswordAuthentication import jcifs.smb.SmbFile String url = "smb://myserver.com" String fullPath = ( url + "/path/to/file.txt" ) smbAuth = new NtlmPasswordAuthentication( url, context.expand( '${#TestCase#username}' ), context.expand( '${#TestCase#password}' ) ) dir = new SmbFile( fullPath, smbAuth ) //works log.info dir.getPath() //doesn't work log.info dir.isFile()
Getting this error:
jcifs.smb.SmbException: jcifs.util.transport.TransportException java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:209) at java.net.SocketInputStream.read(SocketInputStream.java:141) at jcifs.util.transport.Transport.readn(Transport.java:29) at jcifs.smb.SmbTransport.peekKey(SmbTransport.java:351) at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:267) at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:298) at jcifs.util.transport.Transport.run(Transport.java:223) at java.lang.Thread.run(Thread.java:745) at jcifs.util.transport.Transport.run(Transport.java:239) at java.lang.Thread.run(Thread.java:745) error at line: 15
I appreciate any assistance!
Related Content
- 8 years ago
- 6 years ago
- 4 years ago
Recent Discussions
- 21 days ago