StringBuffer buff = new StringBuffer();
buff.append(this.getClass().getName()).append("_");
buff.append(this.directory.toString()).append("_");
CRC32 crc32 = new CRC32();
crc32.update(0);
long filesize = 0;
long filemodify = 0;
if (filelist != null) {
buff.append(filelist.length).append("_");
for (String s : filelist) {
crc32.update(new String(s).getBytes());
FileStatus fstatus=null;
try {
fstatus=this.fileStatus(s) ;
} catch (Throwable e) {
fstatus=null;
logger.error("fileStatus", e);
}
if(fstatus!=null)
{
filesize += fstatus.getLen();
filemodify = Math.max(filemodify, fstatus.getModificationTime());
}
}
}
long crcvalue = crc32.getValue();
buff.append(crcvalue).append("_");
buff.append(filesize).append("_");
buff.append(filemodify).append("_");
buff.append(format.format(new Date(filemodify)));
rtn = buff.toString();