// TODO Auto-generated constructor stub
}
@Override
public ResumptionToken parse(String resumptionToken) throws BadResumptionToken {
if (resumptionToken == null) return new ResumptionToken();
String[] res = resumptionToken.split("/", -1);
if (res.length != 5) throw new BadResumptionToken();
else {
try {
int offset = Integer.parseInt(res[4]);
String prefix = (res[0].equals("")) ? null : res[0];
String set = (res[3].equals("")) ? null : res[3];
Date from = (res[1].equals("")) ? null : DateUtils.parse(res[1]);
Date until = res[2].equals("") ? null : DateUtils.parse(res[2]);
return new ResumptionToken(offset, prefix, set, from, until);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new BadResumptionToken();
}
}