errors.add("The following file is not a valid format, it must be an 'xxxx_annotations.json' or 'xxxx_documents.json' format: "+multipartFile.getOriginalFilename()+".");
errors.add("The following document is incomplete : "+string+", please review that both files : "+string+"_annotations.json and "+string+"_documents.json where included.");
errors.add("The following document is incomplete : "+string+", please review that both files : "+string+"_annotations.json and "+string+"_documents.json where included.");
//String name = multipartFile.getOriginalFilename().subSequence(0, multipartFile.getOriginalFilename().indexOf("_documents.json")).toString();
Stringname=doc.getString("name");
errors.add("The document "+name+" has a documentId ("+doc.getLong("id")+") that was already processed and is present in the database. A document with the same documentId cannot be processed again.");
}
}catch(IOExceptione){
// TODO Auto-generated catch block
e.printStackTrace();
}
}
returnnewArrayList<String>(errors);
}
/**
* Validate if there the is a document with the same name in the database
//String name = multipartFile.getOriginalFilename().subSequence(0, multipartFile.getOriginalFilename().indexOf("_documents.json")).toString();
Stringname=doc.getString("name");
errors.add("The document with the name: "+name+" was already processed and is present in the database. If you want to process again please select the option 'Allowing duplicates'. You will have two documents with the same name, you can difference them throught the process date. You shoud use this option if you want to upload the same document with different pipelines executions.");