Package com.dtolabs.rundeck.core.common.impl

Examples of com.dtolabs.rundeck.core.common.impl.URLFileUpdater


            urlFileUpdaterBuilder
                .setCacheMetadataFile(destinationCacheData)
                .setCachedContent(destinationTempFile)
                .setUseCaching(true);
        }
        final URLFileUpdater updater = urlFileUpdaterBuilder.createURLFileUpdater();
        try {
            if (null != interaction) {
            //allow mock
                updater.setInteraction(interaction);
            }
            UpdateUtils.update(updater, destinationTempFile);

            logger.debug("Updated nodes resources file: " + destinationTempFile);
        } catch (UpdateUtils.UpdateException e) {
View Full Code Here


            urlFileUpdaterBuilder
                .setCacheMetadataFile(destinationCacheData)
                .setCachedContent(destinationTempFile)
                .setUseCaching(true);
        }
        final URLFileUpdater updater = urlFileUpdaterBuilder.createURLFileUpdater();
        try {
            if (null != interaction) {
                //allow mock
                updater.setInteraction(interaction);
            }
            UpdateUtils.update(updater, destinationTempFile);

            logger.debug("Updated nodes resources file: " + destinationTempFile);
        } catch (UpdateUtils.UpdateException e) {
            if (!destinationTempFile.isFile() || destinationTempFile.length() < 1) {
                throw new ResourceModelSourceException(
                    "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
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.common.impl.URLFileUpdater

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.