* @param responseLine
* @return
*/
protected Resource lslToResource(String file, String responseLine) {
if (responseLine == null || responseLine.startsWith("ls")) {
return new BasicResource(file, false, 0, 0, false);
} else {
String[] parts = responseLine.split("\\s+");
if (parts.length != 9) {
Message.debug("unrecognized ls format: "+responseLine);
return new BasicResource(file, false, 0, 0, false);
} else {
try {
long contentLength = Long.parseLong(parts[3]);
String date = parts[4]+" "+parts[5]+" "+parts[6]+" "+parts[7];
return new BasicResource(file, true, contentLength, FORMAT.parse(date).getTime(), false);
} catch (Exception ex) {
Message.warn("impossible to parse server response: "+responseLine+": "+ex);
return new BasicResource(file, false, 0, 0, false);
}
}
}
}