/** * * @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 Path transferChecksum( final Wagon wagon, final RemoteRepository remoteRepository, final String remotePath, final Path resource, final Path workingDir, final String ext ) throws AuthorizationException, TransferFailedException, ResourceDoesNotExistException { Path destFile = workingDir.resolve( resource.getFileName() + ext ); String remoteChecksumPath = remotePath + ext; log.info( "Retrieving {} from {}", remoteChecksumPath, remoteRepository.getName() ); wagon.get( addParameters( remoteChecksumPath, remoteRepository ), destFile.toFile() ); log.debug( "Downloaded successfully." ); return destFile; }
log.debug( "Retrieving {} from {}", remotePath, remoteRepository.getRepository().getName() ); wagon.get( addParameters( remotePath, remoteRepository.getRepository() ), destFile.toFile() ); success = true; log.debug( "Retrieving {} from {} if updated", remotePath, remoteRepository.getRepository().getName() ); try
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;
cfg.setType(remoteRepository.getType().toString()); cfg.setId(remoteRepository.getId()); cfg.setName(remoteRepository.getName()); cfg.setDescription(remoteRepository.getDescription()); cfg.setUrl(remoteRepository.getLocation().toString());
@Override public RemoteRepositoryConfiguration getRemoteConfiguration( RemoteRepository remoteRepository ) { RemoteRepositoryConfiguration configuration = new RemoteRepositoryConfiguration( ); configuration.setId( remoteRepository.getId( ) ); configuration.setName( remoteRepository.getName( ) ); configuration.setDescription( remoteRepository.getDescription( ) ); configuration.setLayout( remoteRepository.getLayout( ) ); configuration.setRefreshCronExpression( remoteRepository.getSchedulingDefinition( ) ); configuration.setCheckPath( remoteRepository.getCheckPath( ) ); configuration.setExtraHeaders( remoteRepository.getExtraHeaders( ) ); configuration.setExtraParameters( remoteRepository.getExtraParameters( ) ); configuration.setTimeout( (int) remoteRepository.getTimeout( ).getSeconds( ) ); RepositoryCredentials creds = remoteRepository.getLoginCredentials( ); if (creds!=null) { PasswordCredentials pwdCreds = (PasswordCredentials) creds; configuration.setUsername( pwdCreds.getUsername( ) ); configuration.setPassword( new String( pwdCreds.getPassword( ) ) ); } configuration.setUrl( remoteRepository.getLocation( ) == null ? "" : remoteRepository.getLocation().toString( ) ); RemoteIndexFeature rif = remoteRepository.getFeature( RemoteIndexFeature.class ).get( ); configuration.setDownloadRemoteIndex( rif.isDownloadRemoteIndex( ) ); configuration.setDownloadRemoteIndexOnStartup( rif.isDownloadRemoteIndexOnStartup( ) ); configuration.setIndexDir( rif.getIndexUri( )==null ? "" : rif.getIndexUri().toString( ) ); configuration.setRemoteDownloadNetworkProxyId( rif.getProxyId( ) ); return configuration; }