org.apache.maven.wagon.events.TransferListener Java Examples

The following examples show how to use org.apache.maven.wagon.events.TransferListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NexusRepositoryIndexerImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private WagonHelper.WagonFetcher createFetcher(final Wagon wagon, TransferListener listener, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) {
    if(isDiag()) {
        return new WagonHelper.WagonFetcher(wagon, listener, authenticationInfo, proxyInfo) {
            @Override
            public InputStream retrieve(String name) throws IOException, FileNotFoundException {
                String id = wagon.getRepository().getId();
                if(name.contains("properties") && System.getProperty("maven.diag.index.properties." + id) != null) { // NOI18N
                    LOGGER.log(Level.INFO, "maven indexer will use local properties file: {0}", System.getProperty("maven.diag.index.properties." + id)); // NOI18N
                    return new FileInputStream(new File(System.getProperty("maven.diag.index.properties." + id))); // NOI18N
                } else if(name.contains(".gz") && System.getProperty("maven.diag.index.gz." + id) != null) { // NOI18N
                    LOGGER.log(Level.INFO, "maven indexer will use gz file: {0}", System.getProperty("maven.diag.index.gz." + id)); // NOI18N
                    return new FileInputStream(new File(System.getProperty("maven.diag.index.gz." + id))); // NOI18N
                }
                return super.retrieve(name);
            }
        };
    } else {
        return new WagonHelper.WagonFetcher(wagon, listener, authenticationInfo, proxyInfo);
    }
}
 
Example #2
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 5 votes vote down vote up
@Override
public void fireTransferInitiated(Resource resource, int requestType) {
    TransferEvent event = new TransferEvent(this.wagon, resource, TransferEvent.TRANSFER_INITIATED, requestType);
    for (TransferListener transferListener : this.transferListeners) {
        transferListener.transferInitiated(event);
    }
}
 
Example #3
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 5 votes vote down vote up
@Override
public void fireTransferStarted(Resource resource, int requestType) {
    TransferEvent event = new TransferEvent(this.wagon, resource, TransferEvent.TRANSFER_STARTED, requestType);
    for (TransferListener transferListener : this.transferListeners) {
        transferListener.transferStarted(event);
    }
}
 
Example #4
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 5 votes vote down vote up
@Override
public void fireTransferProgress(Resource resource, int requestType, byte[] buffer, int length) {
    TransferEvent event = new TransferEvent(this.wagon, resource, TransferEvent.TRANSFER_PROGRESS, requestType);
    for (TransferListener transferListener : this.transferListeners) {
        transferListener.transferProgress(event, buffer, length);
    }
}
 
Example #5
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 5 votes vote down vote up
@Override
public void fireTransferCompleted(Resource resource, int requestType) {
    TransferEvent event = new TransferEvent(this.wagon, resource, TransferEvent.TRANSFER_COMPLETED, requestType);
    for (TransferListener transferListener : this.transferListeners) {
        transferListener.transferCompleted(event);
    }
}
 
Example #6
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 5 votes vote down vote up
@Override
public void fireTransferError(Resource resource, int requestType, Exception exception) {
    TransferEvent event = new TransferEvent(this.wagon, resource, exception, requestType);
    for (TransferListener transferListener : this.transferListeners) {
        transferListener.transferError(event);
    }
}
 
Example #7
Source File: MockWagon.java    From archiva with Apache License 2.0 4 votes vote down vote up
@Override
public boolean hasTransferListener( TransferListener transferListener )
{
    return false;
}
 
Example #8
Source File: MockWagon.java    From archiva with Apache License 2.0 4 votes vote down vote up
@Override
public void removeTransferListener( TransferListener transferListener )
{

}
 
Example #9
Source File: MockWagon.java    From archiva with Apache License 2.0 4 votes vote down vote up
@Override
public void addTransferListener( TransferListener transferListener )
{

}
 
Example #10
Source File: WagonDelegate.java    From archiva with Apache License 2.0 4 votes vote down vote up
@Override
public boolean hasTransferListener( TransferListener listener )
{
    return delegate.hasTransferListener( listener );
}
 
Example #11
Source File: WagonDelegate.java    From archiva with Apache License 2.0 4 votes vote down vote up
@Override
public void removeTransferListener( TransferListener listener )
{
    delegate.removeTransferListener( listener );
}
 
Example #12
Source File: WagonDelegate.java    From archiva with Apache License 2.0 4 votes vote down vote up
@Override
public void addTransferListener( TransferListener listener )
{
    delegate.addTransferListener( listener );
}
 
Example #13
Source File: AbstractWagon.java    From lambadaframework with MIT License 4 votes vote down vote up
@Override
public final void removeTransferListener(TransferListener transferListener) {
    this.transferListenerSupport.removeTransferListener(transferListener);
}
 
Example #14
Source File: AbstractWagon.java    From lambadaframework with MIT License 4 votes vote down vote up
@Override
public final boolean hasTransferListener(TransferListener transferListener) {
    return this.transferListenerSupport.hasTransferListener(transferListener);
}
 
Example #15
Source File: AbstractWagon.java    From lambadaframework with MIT License 4 votes vote down vote up
@Override
public final void addTransferListener(TransferListener transferListener) {
    this.transferListenerSupport.addTransferListener(transferListener);
}
 
Example #16
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 4 votes vote down vote up
@Override
public boolean hasTransferListener(TransferListener transferListener) {
    return this.transferListeners.contains(transferListener);
}
 
Example #17
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 4 votes vote down vote up
@Override
public void removeTransferListener(TransferListener transferListener) {
    this.transferListeners.remove(transferListener);
}
 
Example #18
Source File: StandardTransferListenerSupport.java    From lambadaframework with MIT License 4 votes vote down vote up
@Override
public void addTransferListener(TransferListener transferListener) {
    if (transferListener != null) {
        this.transferListeners.add(transferListener);
    }
}
 
Example #19
Source File: TransferListenerSupport.java    From lambadaframework with MIT License 2 votes vote down vote up
/**
 * Returns whether a {@link TransferListener} is already in the collection of {@link TransferListener}s to be
 * notified
 *
 * @param transferListener the {@link TransferListener} to look for
 * @return {@code true} if the {@link TransferListener} is already in the collection of {@link TransferListener}s to
 * be notified, otherwise {@code false}
 */
boolean hasTransferListener(TransferListener transferListener);
 
Example #20
Source File: TransferListenerSupport.java    From lambadaframework with MIT License 2 votes vote down vote up
/**
 * Remove a {@link TransferListener} so that it is no longer notified
 *
 * @param transferListener The {@link TransferListener} that should no longer be notified
 */
void removeTransferListener(TransferListener transferListener);
 
Example #21
Source File: TransferListenerSupport.java    From lambadaframework with MIT License 2 votes vote down vote up
/**
 * Add a {@link TransferListener} to be notified
 *
 * @param transferListener The {@link TransferListener} to be notified
 */
void addTransferListener(TransferListener transferListener);