expires = expiresString != null ? new DateType( expiresString, null, null ) : null;
}
catch ( ParseException e )
{
String msg = "Failed to parse catalog expires date [" + expiresString + "].";
ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils.createIssueForException( msg, this.reader, e );
log.warn( "parseStartElement(): " + issue.getMessage(), e );
// ToDo Gather issues rather than throw exception.
throw new ThreddsXmlParserException( issue );
}
Attribute lastModifiedAtt = startElement.getAttributeByName( CatalogElementNames.CatalogElement_LastModified );
String lastModifiedString = lastModifiedAtt != null ? lastModifiedAtt.getValue() : null;
DateType lastModified = null;
try {
lastModified = lastModifiedString != null ? new DateType( lastModifiedString, null, null ) : null;
}
catch ( ParseException e )
{
String msg = "Failed to parse catalog lastModified date [" + lastModifiedString + "].";
ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils.createIssueForException( msg, this.reader, e );
log.warn( "parseStartElement(): " + issue.getMessage(), e );
// ToDo Gather issues rather than throw exception.
throw new ThreddsXmlParserException( issue );
}
URI docBaseUri = null;
try {
docBaseUri = new URI( docBaseUriString );
}
catch ( URISyntaxException e )
{
String msg = "Bad catalog base URI [" + docBaseUriString + "].";
ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils.createIssueForException( msg, this.reader, e );
log.warn( "parseStartElement(): " + issue.getMessage(), e );
// ToDo Gather issues rather than throw exception.
throw new ThreddsXmlParserException( issue );
}
this.selfBuilder = builderFactory.newCatalogBuilder( nameString, docBaseUri, versionString, expires, lastModified );
}