jcifs

How do I use JCIFS with apache VFS to access an SMB URL - part 2?

不打扰是莪最后的温柔 提交于 2019-12-13 09:47:31
问题 I had the same problem: How do I use JCIFS with apache VFS to access an SMB URL? ... after including commons-vfs-sandbox-2.1-SNAPSHOT.jar in the classpath I now get this exception: Exception in thread "main" org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "smb://10.10.18.210/CIFS/123/asd". at org.apache.commons.vfs2.provider.AbstractFileObject.attach(AbstractFileObject.java:1522) at org.apache.commons.vfs2.provider.AbstractFileObject.getType

jcifs.smb.SmbException: Access is Denied. exception for smb directories

若如初见. 提交于 2019-12-13 00:12:07
问题 In the below code statement: SmbFileInputStream din==new SmbFileInputStream(src); I am trying to create a SmbFileInputStream object. This will works fine if SmbFile 'src' is a file, but if 'src' is a smb Directory then it throws exception: jcifs.smb.SmbException: Access is Denied. at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:622) at jcifs.smb.SmbTransport.send(SmbTransport.java:722) at jcifs.smb.SmbSession.send(SmbSession.java:262) at jcifs.smb.SmbTree.send(SmbTree.java:119) at

How can I read from a Windows shared drive in a platform independent way using Java?

混江龙づ霸主 提交于 2019-12-12 20:17:24
问题 How can I read from a Windows shared drive using Java in such a way that the Java code which performs the reading could run equally correctly on any platform? 回答1: You can use JCIFS to access SMB/CIFS shares using pure Java code. 回答2: apache commons vfs is always a good choice. 来源: https://stackoverflow.com/questions/3100625/how-can-i-read-from-a-windows-shared-drive-in-a-platform-independent-way-using-j

not valid lastModified from smbfile of JCIFS library

此生再无相见时 提交于 2019-12-11 17:54:15
问题 I suspect that there is a bug in smbfile of JCIFS library as I get only "Thu Jan 01 08:00:00 GMT+08:00 1970" for any dates from getLastModified(); lastModified(); when I do a window share to android device. I am looping through the exist files and is able to do file copy operation, so mis-spelling of file name or path is not possible. I want to get one of the filedate of MS Window file , no matter it is the creation date, lastmodified date or accessed date. filedatetime = mWindowFile

Android: SMB file access crashing

你。 提交于 2019-12-11 12:13:55
问题 I am trying to log on to my windows server to download a file using jcifs. The app works fine on my android 2.2 phone and an old 2.3 tablet. I just purchased a Le Pan II which I upgraded to 4.0.3. When I try to run my app it's crashing when trying to access the server. Is there anything new I need to do for 4.0.3? I tried commenting out everything pertaining to the output stream to make sure it was the input side causing the problem. If I comment out everything inside the innermost try block

Can JCIFS be used with Jersey?

流过昼夜 提交于 2019-12-11 05:28:14
问题 I have trouble adding NTLM authentication to my existing application that uses Jersey and Apache HttpClient. I was only able to authenticate using JCIFS, the default NTLM authentication from HttpClient does not work (I get 401 ). The example from Apache HttpClient page shows how to use CloseableHttpClient: https://hc.apache.org/httpcomponents-client-4.5.x/ntlm.html Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create() .register(AuthSchemes.NTLM, new

KSoap-Android\JCIFS sends empty HTTP post

耗尽温柔 提交于 2019-12-10 14:04:46
问题 I created an NTLM authenticating SOAP client based on KSOAP-Android and JCIFS. The implementation looks something like this: public class NtlmServiceConnection implements ServiceConnection { public NtlmServiceConnection(final SoapConnectionInfo connectionInfo, String path) { httpclient = new DefaultHttpClient(); httpclient.getAuthSchemes().register(AuthPolicy.NTLM, new NTLMSchemeFactory()); //... @Override public InputStream openInputStream() throws IOException { ByteArrayEntity re = new

Simplest way to read a file using jcifs

倖福魔咒の 提交于 2019-12-10 11:13:50
问题 I am trying to read a file from a network share using the external jcifs library. Most sample codes I can find for reading files are quite complex, potentially unnecessarily so. I have found a simple way to write to a file as seen below. Is there a way to read a file using similar syntax? SmbFile file= null; try { String url = "smb://"+serverAddress+"/"+sharename+"/TEST.txt"; NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, username, password); file = new SmbFile(url,

JCIFS SmbException

浪尽此生 提交于 2019-12-10 02:30:47
问题 I am trying to access a shared folder in my company network via JCIFS. But when i try to list the files under the shared folder, it throws an SmbException as below, jcifs.smb.SmbException: 0xC000009A at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563) at jcifs.smb.SmbTransport.send(SmbTransport.java:663) at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:316) at jcifs.smb.SmbSession.send(SmbSession.java:218) at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176) at jcifs.smb.SmbFile

iText Java - add header to an existing pdf

為{幸葍}努か 提交于 2019-12-08 06:02:20
问题 I want to add an header to an existing pdf using iText. I had no problem except that sometimes my function create a pdf with the correct header and footer but with the existing pdf page rotated. private static void print(Sldocuments item, String header, String footer) { try { String ftpFilename = item.getId()+"_"+item.getDocumentname(); String newName= String.valueOf(item.getId())+".pdf"; String path = (Global.SHARED_FOLDER_DEVELOPER); String smbUser = "**;"+"**" + ":" + "**";