/** * Update the nodes resources file from a specific URL, with BASIC authentication as provided or * as defined in the URL's userInfo section. * * @param providerURL URL to retrieve resources file definition * @param username username or null * @param password or null * @throws com.dtolabs.rundeck.core.common.UpdateUtils.UpdateException if an error occurs during * the update process */ public void updateNodesResourceFileFromUrl( final String providerURL, final String username, final String password) throws UpdateUtils.UpdateException { if (!validateResourceProviderURL(providerURL)) { throw new UpdateUtils.UpdateException("providerURL is not allowed: " + providerURL); } UpdateUtils.updateFileFromUrl(providerURL, getNodesResourceFilePath(), username, password); logger.debug("Updated nodes resources file: " + getNodesResourceFilePath()); }
/** * Update the nodes resources file from a specific URL, with BASIC authentication as provided or * as defined in the URL's userInfo section. * * @param providerURL URL to retrieve resources file definition * @param username username or null * @param password or null * @param nodesResourceFilePath path of the destination file * @throws com.dtolabs.rundeck.core.common.UpdateUtils.UpdateException if an error occurs during * the update process */ @Override public void updateNodesResourceFileFromUrl( final String providerURL, final String username, final String password, final String nodesResourceFilePath) throws UpdateUtils.UpdateException { if (!validateResourceProviderURL(providerURL)) { throw new UpdateUtils.UpdateException("providerURL is not allowed: " + providerURL); } UpdateUtils.updateFileFromUrl( providerURL, nodesResourceFilePath, username, password, URLFileUpdater.factory()); logger.debug("Updated nodes resources file: " + nodesResourceFilePath); }