[jcifs] SmbFile reports incorrect file dates
Simon van der Sluis
simon.vandersluis at edmi.co.nz
Wed Jun 11 18:26:58 MDT 2014
When attempting to get the file date from a SmbFile it always returns 0.
Connecting to the same smb share using finder in OSX returns the correct files
dates.
The share is setup using a samba on a debian based linux box, samba version
3.6.6 running on a virtual box VM.
Using finder
----------
Server: smb://192.168.56.101/share/file.txt
Created: Today 11:53 am
Modified: Today 11:53 am
Using jcifs
---------
getLastModified() = 0
new Date(getLastModified()) = Thu Jan 01 12:00:00 GMT+12:00 1970
new Date(lastModified()) = Thu Jan 01 12:00:00 GMT+12:00 1970
new Date(createTime()) = Thu Jan 01 12:00:00 GMT+12:00 1970
new Date(getDate()) = Thu Jan 01 12:00:00 GMT+12:00 1970
Below is the unit test I have used:
@Test
@Ignore("Dependent on Simons virtual machine")
public void smbLastModifiedDate() throws Exception {
SmbFile smbFile = SmbFileUtil.connect("smb://192.168.56.101/share/fie.txt",
"", "johan", "cruyff");
System.out.println("getLastModified() = " + smbFile.getLastModified());
System.out.println("new Date(getLastModified()) = "
+ new Date(smbFile.getLastModified()));
System.out.println("new Date(lastModified()) = "
+ new Date(smbFile.lastModified()));
System.out.println("new Date(createTime()) = "
+ new Date(smbFile.createTime()));
System.out.println("new Date(getDate()) = "
+ new Date(smbFile.getDate()));
}
Can anyone shed some light on this?
More information about the jCIFS
mailing list