* <code>String</code>.
* @throws ReviewException if problems occur during file reading process.
*/
static boolean isReviewIdAssociatedFile(String reviewId, File reviewFile)
throws ReviewException {
Review review;
try {
XMLInputFactory xmlif = XMLInputFactory.newInstance();
xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE);
xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
XMLStreamReader reader = xmlif.createXMLStreamReader(reviewFile.getAbsolutePath(),
new FileInputStream(reviewFile));
review = StaxReviewXmlUtil.parseReviewFile(reader);
}
catch (XMLStreamException e) {
throw new ReviewException("XMLStreamException: " + e.getMessage(), e);
}
catch (FileNotFoundException e) {
throw new ReviewException("FileNotFoundException: " + e.getMessage(), e);
}
String reviewIdName = review.getId();
return (reviewIdName != null && reviewIdName.equals(reviewId));
}