- @Override
- public void visit(List<String> row) throws CadiException {
- if(row.size()<3) {
- throw new CadiException("CSV file " + csv + " must have at least 2 Basic Auth columns and an Expiration Date(YYYYMMDD) in each row");
- }
- try {
- Date date = sdf.parse(row.get(2));
- String oldID = row.get(0);
- String newID = row.get(1);
- if(date.after(now)) {
- if(!oldID.startsWith(BASIC) && newID.startsWith(BASIC)) {
- throw new CadiException("CSV file " + csv + ": Uncredentialed ID " + idFromBasic(oldID,null) +
- " may not transfer to credentialed ID " + idFromBasic(newID,null));
- } else {
- map.put(oldID,newID);
- access.printf(Level.INIT, "ID Conversion from %s to %s enabled",
- idFromBasic(oldID,null),
- idFromBasic(newID,null));
- }
- } else {
- access.printf(Level.INIT, "ID Conversion from %s to %s has expired.",
- idFromBasic(oldID,null),
- idFromBasic(newID,null));
- }
- } catch (ParseException e) {
- throw new CadiException("Cannot Parse Date: " + row.get(2));
- } catch (IOException e) {
- throw new CadiException(e);
- }
- }
- });
+ @Override
+ public void visit(List<String> row) throws CadiException {
+ if(row.size()<3) {
+ throw new CadiException("CSV file " + csv + " must have at least 2 Basic Auth columns and an Expiration Date(YYYY-MM-DD) in each row");
+ }
+ try {
+ Date date = sdf.parse(row.get(2));
+ String oldID = row.get(0);
+ String newID = row.get(1);
+ if(date.after(now)) {
+ if(!oldID.startsWith(BASIC) && newID.startsWith(BASIC)) {
+ throw new CadiException("CSV file " + csv + ": Uncredentialed ID " + idFromBasic(oldID,null) +
+ " may not transfer to credentialed ID " + idFromBasic(newID,null));
+ } else {
+ map.put(oldID,newID);
+ access.printf(Level.INIT, "ID Conversion from %s to %s enabled",
+ idFromBasic(oldID,null),
+ idFromBasic(newID,null));
+ }
+ } else {
+ access.printf(Level.INIT, "ID Conversion from %s to %s has expired.",
+ idFromBasic(oldID,null),
+ idFromBasic(newID,null));
+ }
+ } catch (ParseException e) {
+ throw new CadiException("Cannot Parse Date: " + row.get(2));
+ } catch (IOException e) {
+ throw new CadiException(e);
+ }
+ }
+ });