@Override public InputStream retrieve( String name ) throws IOException, FileNotFoundException { try { log.info( "index update retrieve file, name:{}", name ); Path file = tempIndexDirectory.resolve( name ); Files.deleteIfExists( file ); file.toFile( ).deleteOnExit( ); wagon.get( addParameters( name, remoteRepository ), file.toFile( ) ); return Files.newInputStream( file ); } catch ( AuthorizationException | TransferFailedException e ) { throw new IOException( e.getMessage( ), e ); } catch ( ResourceDoesNotExistException e ) { FileNotFoundException fnfe = new FileNotFoundException( e.getMessage( ) ); fnfe.initCause( e ); throw fnfe; } }
/** * Constructs a new WagonException with the specified detail message. * The cause is not initialized, and may subsequently be initialized by a call to initCause * * @param message - the detail message (which is saved for later retrieval by the getMessage() method). * @param cause - the cause (which is saved for later retrieval by the getCause() method). * (A null value is permitted, and indicates that the cause is nonexistent or unknown.) */ public WagonException( final String message, final Throwable cause ) { super( message ); initCause( cause ); }
"Download failure on resource [" + remoteRepository.getURL() + "/" + remotePath + "]:" + e.getMessage(); if ( e.getCause() != null ) msg += " (cause: " + e.getCause() + ")";
"Download failure on resource [" + remoteRepository.getURL() + "/" + remotePath + "]:" + e.getMessage(); if ( e.getCause() != null ) msg += " (cause: " + e.getCause() + ")";
@Override public InputStream retrieve( String name ) throws IOException, FileNotFoundException { try { log.info( "index update retrieve file, name:{}", name ); Path file = tempIndexDirectory.resolve( name ); Files.deleteIfExists( file ); file.toFile().deleteOnExit(); wagon.get( addParameters( name, this.remoteRepository ), file.toFile() ); return Files.newInputStream( file ); } catch ( AuthorizationException | TransferFailedException e ) { throw new IOException( e.getMessage(), e ); } catch ( ResourceDoesNotExistException e ) { FileNotFoundException fnfe = new FileNotFoundException( e.getMessage() ); fnfe.initCause( e ); throw fnfe; } }
/** * Constructs a new WagonException with the specified detail message. * The cause is not initialized, and may subsequently be initialized by a call to initCause * * @param message - the detail message (which is saved for later retrieval by the getMessage() method). * @param cause - the cause (which is saved for later retrieval by the getCause() method). * (A null value is permitted, and indicates that the cause is nonexistent or unknown.) */ public WagonException( final String message, final Throwable cause ) { super( message ); initCause( cause ); }
String msg = "Transfer for " + name + " failed"; logError( msg, e ); IOException ioException = new IOException( msg + "; " + e.getMessage() ); ioException.initCause( e ); throw ioException;
String msg = "Transfer for " + name + " failed"; logError( msg, e ); IOException ioException = new IOException( msg + "; " + e.getMessage() ); ioException.initCause( e ); throw ioException;
IOException ioException = new IOException( msg + "; " + e.getMessage() ); ioException.initCause( e ); throw ioException;
log.warn( "Could not connect to {}: {}", remoteRepository.getRepository().getName(), e.getMessage() ); connected = false;
log.warn( "Could not connect to {}: {}", remoteRepository.getRepository().getName(), e.getMessage() ); connected = false;
new Object[] { file.getURL(), e.getMessage() } ) );
log.error( "Could not connect to {}:{} ", remoteRepository.getName(), e.getMessage() ); connected = false;
log.error( "Could not connect to {}:{} ", remoteRepository.getName(), e.getMessage() ); connected = false;