/** * Creates a new exception with the specified metadata and local repository. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved local repository, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, LocalRepository repository ) { super( metadata, null, "Could not find metadata " + metadata + getString( " in ", repository ) ); }
private MetadataTransferException newException(String error, Metadata metadata, RemoteRepository repository) { if (error == null || error.length() <= 0) { return new MetadataNotFoundException(metadata, repository, "Failure to find " + metadata + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced"); } else { return new MetadataTransferException(metadata, repository, "Failure to transfer " + metadata + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error); } }
private MetadataTransferException newException(String error, Metadata metadata, RemoteRepository repository) { if (error == null || error.length() <= 0) { return new MetadataNotFoundException(metadata, repository, "Failure to find " + metadata + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced"); } else { return new MetadataTransferException(metadata, repository, "Failure to transfer " + metadata + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error); } }
private MetadataTransferException newException( String error, Metadata metadata, RemoteRepository repository ) { if ( error == null || error.length() <= 0 ) { return new MetadataNotFoundException( metadata, repository, "Failure to find " + metadata + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced", true ); } else { return new MetadataTransferException( metadata, repository, "Failure to transfer " + metadata + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error, true ); } }
/** * Creates a new exception with the specified metadata and repository. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, RemoteRepository repository ) { super( metadata, repository, "Could not find metadata " + metadata + getString( " in ", repository ) ); }
private MetadataTransferException newException( String error, Metadata metadata, RemoteRepository repository ) { if ( error == null || error.length() <= 0 ) { return new MetadataNotFoundException( metadata, repository, "Failure to find " + metadata + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced", true ); } else { return new MetadataTransferException( metadata, repository, "Failure to transfer " + metadata + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error, true ); } }
/** * Creates a new exception with the specified metadata and local repository. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved local repository, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, LocalRepository repository ) { super( metadata, null, "Could not find metadata " + metadata + getString( " in ", repository ) ); }
public Exception wrap( MetadataTransfer transfer, Exception e, RemoteRepository repository ) { MetadataTransferException ex = null; e = WagonCancelledException.unwrap( e ); if ( e instanceof ResourceDoesNotExistException ) { ex = new MetadataNotFoundException( transfer.getMetadata(), repository ); } else if ( e != null ) { ex = new MetadataTransferException( transfer.getMetadata(), repository, e ); } transfer.setException( ex ); return ex; }
/** * Creates a new exception with the specified metadata and repository. * * @param metadata The missing metadata, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. */ public MetadataNotFoundException( Metadata metadata, RemoteRepository repository ) { super( metadata, repository, "Could not find metadata " + metadata + getString( " in ", repository ) ); }
@Override public void transferFailed( Exception exception, int classification ) { MetadataTransferException e; if ( classification == Transporter.ERROR_NOT_FOUND ) { e = new MetadataNotFoundException( getTransfer().getMetadata(), repository ); } else { e = new MetadataTransferException( getTransfer().getMetadata(), repository, exception ); } getTransfer().setException( e ); super.transferFailed( e, classification ); }
@Override public void transferFailed( Exception exception, int classification ) { MetadataTransferException e; if ( classification == Transporter.ERROR_NOT_FOUND ) { e = new MetadataNotFoundException( getTransfer().getMetadata(), repository ); } else { e = new MetadataTransferException( getTransfer().getMetadata(), repository, exception ); } getTransfer().setException( e ); super.transferFailed( e, classification ); }
if ( Direction.DOWNLOAD.equals( direction ) ) mdEx = new MetadataNotFoundException( transfer.getMetadata(), repository );
result.setException( new MetadataNotFoundException( metadata, localRepo ) ); + ") in offline mode and the metadata " + metadata + " has not been downloaded from it before"; result.setException( new MetadataNotFoundException( metadata, repository, msg, e ) );
result.setException( new MetadataNotFoundException( metadata, localRepo ) ); + ") in offline mode and the metadata " + metadata + " has not been downloaded from it before"; result.setException( new MetadataNotFoundException( metadata, repository, msg, e ) );