Package com.dtolabs.rundeck.core.resources.format

Examples of com.dtolabs.rundeck.core.resources.format.ResourceFormatParser


                    "Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": " + e.getMessage(), e);
            } else {
                logger.error("Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": " + e.getMessage(), e);
            }
        }
        final ResourceFormatParser parser;
        if ("file".equalsIgnoreCase(configuration.nodesUrl.getProtocol())) {
            try {
                parser = framework.getResourceFormatParserService().getParserForFileExtension(new File(
                    configuration.nodesUrl.toURI()));
            } catch (UnsupportedFormatException e) {
                throw new ResourceModelSourceException(
                    "Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": No supported format available for file extension", e);
            } catch (URISyntaxException e) {
                throw new ResourceModelSourceException(
                    "Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": " + e.getMessage(), e);
            }
            logger.debug("Determined URL content format from file name: " + configuration.nodesUrl);
        } else {
            final String mimetype = updater.getContentType();
            try {
                parser = framework.getResourceFormatParserService().getParserForMIMEType(mimetype);
            } catch (UnsupportedFormatException e) {
                throw new ResourceModelSourceException(
                    "Error requesting URL Resource Model Source: " + configuration.nodesUrl
                    + ": Response content type is not supported: " + mimetype, e);
            }
            logger.debug("Determined URL content format from MIME type: " + mimetype);
        }
        if (destinationTempFile.isFile() && destinationTempFile.length() > 0) {
            try {
                return parser.parseDocument(destinationTempFile);
            } catch (ResourceFormatParserException e) {
                throw new ResourceModelSourceException(
                    "Error requesting URL Resource Model Source: " + configuration.nodesUrl
                    + ": Content could not be parsed: "+e.getMessage(),e);
            }
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.resources.format.ResourceFormatParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.