/** * Takes a line and looks for an archive request tag. If one is found, the information from the * tag is returned as an <CODE>ArchiveRequest</CODE>. If a tag is found, the data in the tag is * stored in the <CODE>HashMap</CODE> provided. * * @param currentLine The line in which to look for the archive tag. * @param group The <CODE>ArchiveGroup</CODE> to which to add the <CODE>ArchiveRequest</CODE>. Can * be <CODE>null</CODE>. * @param template The <CODE>Template</CODE> to which the <CODE>ArchiveRequest</CODE> belongs. * @return The archive request tag data as an instance of <CODE>ArchiveRequest</CODE>, <CODE>null * </CODE> if the line passed in does not contain an arFile tag. */ private ArchiveRequest parseArchiveRequestTag( String currentLine, ArchiveGroup group, Template template) { ArchiveRequest archiveTag; Matcher currentMatcher = archiveRequestPattern.matcher(currentLine); if (currentMatcher.find()) { String fileName = currentMatcher.group(1); archiveTag = template.getArchiveRequest(fileName); if (archiveTag == null) { archiveTag = new ArchiveRequest(fileName); template.addArchiveRequest(archiveTag); } if (group != null) { // Creating a new request object because the requests // in the groups flagged as not in database will mean the // group - request association is not in database. Requests // in the archiveRequests map flagged as not in database // means the request record is not there. String requestFileName = archiveTag.getFileName(); String requestFileLocation = archiveTag.getFileLocation(); ArchiveRequest groupRequest = new ArchiveRequest(requestFileLocation, requestFileName); group.addArchiveRequest(groupRequest); } } else archiveTag = null; return archiveTag; }