/** * * @param wagon The wagon instance that should be connected. * @param remoteRepository The repository from where the checksum file should be retrieved * @param remotePath The remote path of the artifact (without extension) * @param resource The local artifact (without extension) * @param workingDir The working directory where the downloaded file should be placed to * @param ext The extension of th checksum file * @return The file where the data has been downloaded to. * @throws AuthorizationException * @throws TransferFailedException * @throws ResourceDoesNotExistException */ private File transferChecksum( final Wagon wagon, final RemoteRepository remoteRepository, final String remotePath, final File resource, final File workingDir, final String ext ) throws AuthorizationException, TransferFailedException, ResourceDoesNotExistException { File destFile = new File( workingDir, resource.getName() + ext ); String remoteChecksumPath = remotePath + ext; log.info( "Retrieving {} from {}", remoteChecksumPath, remoteRepository.getName() ); wagon.get( addParameters( remoteChecksumPath, remoteRepository ), destFile ); log.debug( "Downloaded successfully." ); return destFile; }
log.debug( "Retrieving {} from {}", remotePath, remoteRepository.getRepository().getName() ); wagon.get( addParameters( remotePath, remoteRepository.getRepository() ), destFile ); success = true; log.debug( "Retrieving {} from {} if updated", remotePath, remoteRepository.getRepository().getName() ); success = wagon.getIfNewer( addParameters( remotePath, remoteRepository.getRepository() ), destFile, origFile.lastModified() );
log.info( "Retrieving {} from {}", artifactPath, remoteRepository.getName() );
log.warn( "Could not connect to {}: {}", remoteRepository.getRepository().getName(), e.getMessage() ); connected = false;
log.error( "Could not connect to {}:{} ", remoteRepository.getName(), e.getMessage() ); connected = false;
private RemoteRepositoryConfiguration getRemoteRepositoryConfiguration( RemoteRepository remoteRepository ) { RemoteRepositoryConfiguration remoteRepositoryConfiguration = new RemoteRepositoryConfiguration(); remoteRepositoryConfiguration.setId( remoteRepository.getId() ); remoteRepositoryConfiguration.setPassword( remoteRepository.getPassword() ); remoteRepositoryConfiguration.setTimeout( remoteRepository.getTimeout() ); remoteRepositoryConfiguration.setUrl( remoteRepository.getUrl() ); remoteRepositoryConfiguration.setUsername( remoteRepository.getUserName() ); remoteRepositoryConfiguration.setLayout( remoteRepository.getLayout() ); remoteRepositoryConfiguration.setName( remoteRepository.getName() ); remoteRepositoryConfiguration.setDownloadRemoteIndex( remoteRepository.isDownloadRemoteIndex() ); remoteRepositoryConfiguration.setRemoteIndexUrl( remoteRepository.getRemoteIndexUrl() ); remoteRepositoryConfiguration.setRefreshCronExpression( remoteRepository.getCronExpression() ); remoteRepositoryConfiguration.setIndexDir( remoteRepository.getIndexDirectory() ); remoteRepositoryConfiguration.setRemoteDownloadNetworkProxyId( remoteRepository.getRemoteDownloadNetworkProxyId() ); remoteRepositoryConfiguration.setRemoteDownloadTimeout( remoteRepository.getRemoteDownloadTimeout() ); remoteRepositoryConfiguration.setDownloadRemoteIndexOnStartup( remoteRepository.isDownloadRemoteIndexOnStartup() ); remoteRepositoryConfiguration.setDescription( remoteRepository.getDescription() ); remoteRepositoryConfiguration.setExtraHeaders( remoteRepository.getExtraHeaders() ); remoteRepositoryConfiguration.setExtraParameters( remoteRepository.getExtraParameters() ); remoteRepositoryConfiguration.setCheckPath(remoteRepository.getCheckPath()); return remoteRepositoryConfiguration; }