As for everything, you have to look in the source code to understand what's going on. That's a pity that such a nice library has no documentation... :o(
Class com.jcraft.jsch.SftpATTRS needs to be fixed.
The following code is wrong because of locale issue:
public String getAtimeString(){
SimpleDateFormat locale=new SimpleDateFormat();
return (locale.format(new Date(atime)));
}
it must be replaced by:
public String getAtimeString(){
Date date= new Date(((long)atime)*1000);
return (date.toString());
}
As you can see, the ATime (creation time) and MTime (mod date) are not in milisecs but in secs from midnight, January 1, 1970 UTC.
Would be nice to also have the following methods added to the class:
public Date getADate();
public Date getMDate();
Best Regards,
Gam
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1007725
WinSSHD 4.2
Logged In: YES
user_id=1007725
Tried to get file details using FileZilla. It showed correct
value. :(
Logged In: YES
user_id=1077046
Originator: NO
As for everything, you have to look in the source code to understand what's going on. That's a pity that such a nice library has no documentation... :o(
Class com.jcraft.jsch.SftpATTRS needs to be fixed.
The following code is wrong because of locale issue:
public String getAtimeString(){
SimpleDateFormat locale=new SimpleDateFormat();
return (locale.format(new Date(atime)));
}
it must be replaced by:
public String getAtimeString(){
Date date= new Date(((long)atime)*1000);
return (date.toString());
}
As you can see, the ATime (creation time) and MTime (mod date) are not in milisecs but in secs from midnight, January 1, 1970 UTC.
Would be nice to also have the following methods added to the class:
public Date getADate();
public Date getMDate();
Best Regards,
Gam