private static void insertServiceIdentification(CapabilitiesType capabilities) throws XmlException, NoApplicableCodeException { try { URL path = CapabilitiesHelper.class.getResource(SERVICE_IDENTIFICATION); if (path != null) { InputStream is = new FileInputStream(getAbsoluteFilePath(path)); ServiceIdentificationDocument doc = ServiceIdentificationDocument.Factory.parse(is); capabilities.setServiceIdentification(doc.getServiceIdentification()); } else { LOGGER.error("Could find file '{}'.", SERVICE_IDENTIFICATION); } } catch (IOException e) { LOGGER.error("Could not read file '{}'.", SERVICE_IDENTIFICATION, e); throw new NoApplicableCodeException(OwsException.INTERNAL_SERVER_ERROR); } }
public ServiceIdentificationDocument getServiceIdentificationAsDocument() { ServiceIdentificationDocument document = ServiceIdentificationDocument.Factory.newInstance(); document.setServiceIdentification(this.serviceIdentification); return document; }