Jcifs. SMB. SmbException
Jcifs. Util. Transport. TransportException
Java. IO. IOException: Invalid content size: 405
The at jcifs. SMB. SmbTransport. Negotiate (SmbTransport. Java: 279)
The at jcifs. SMB. SmbTransport. DoConnect (SmbTransport. Java: 306)
At jcifs. Util. Transport. Transport. The run (240) transport. Java:
The at Java. Lang. Thread. The run (Thread. Java: 722)
At jcifs. Util. Transport. Transport. The run (256) transport. Java:
The at Java. Lang. Thread. The run (Thread. Java: 722)
The at jcifs. SMB. SmbTransport. Connect (SmbTransport. Java: 296)
The at jcifs. SMB. SmbTree. TreeConnect (SmbTree. Java: 141)
The at jcifs. SMB. SmbFile. DoConnect (SmbFile. Java: 858)
The at jcifs. SMB. SmbFile. Connect (SmbFile. Java: 901)
The at jcifs. SMB. SmbFile. Connect0 (SmbFile. Java: 827)
The at jcifs. SMB. SmbFile. Open0 (SmbFile. Java: 917)
The at jcifs. SMB. SmbFile. Open (SmbFile. Java: 951)
The at jcifs. SMB. SmbFileOutputStream. & lt; Init> (SmbFileOutputStream. Java: 142)
The at jcifs. SMB. SmbFileOutputStream. & lt; Init> (SmbFileOutputStream. Java: 97)
The at jcifs. SMB. SmbFileOutputStream. & lt; Init> (SmbFileOutputStream. Java: 67)
Public static void main (String [] args) {
//password-less
GetShareFile (" SMB://192.168.0.103 msgFloder msg1. TXT ", "D:/test");
}
Public static void getShareFile (String remoteUrl, String savePath) {
Try {
SmbFile SmbFile=new SmbFile (remoteUrl);
If (smbFile!=null) {
The String fileName=smbFile. GetName ();
The File localFile=new File (savePath + File. The separator + fileName);
InputStream is=new BufferedInputStream (new SmbFileInputStream (smbFile));
OutputStream OS=new BufferedOutputStream (new FileOutputStream (localFile));
Byte [] bytes=new byte [1024].
While (is) read (bytes)!=1) {
OS. Write (bytes);
}
os.flush();
os.close();
}
} the catch (Exception e) {
e.printStackTrace();
}
}
CodePudding user response:
Solve???????
CodePudding user response:
The solution? Also meet