org.eclipse.aether.transfer.TransferCancelledException Java Examples

The following examples show how to use org.eclipse.aether.transfer.TransferCancelledException. 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: ProgressTransferListener.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages({
    "# {0} - transferring resource name",
    "TXT_Transferring={0} - Transferring...",
    "# {0} - transferring resource name",
    "# {1} - transferred amount",
    "TXT_Transferred={0} - Transferred {1}"
})
@Override
public void transferProgressed(TransferEvent te) throws TransferCancelledException {
    checkCancel();
    ProgressContributor c = contrib;
    if (c == null) {
        return;
    }
    long cnt = te.getTransferredBytes();
    cnt = Math.min((long)Integer.MAX_VALUE, cnt);
    if (length < 0) {
        c.progress(TXT_Transferring(getResourceName(te.getResource())));
    } else {
        cnt = Math.min(cnt, (long)length);
        c.progress(TXT_Transferred(getResourceName(te.getResource()), cnt), (int)cnt);
    }
}
 
Example #2
Source File: ProgressTransferListener.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public void transferStarted(TransferEvent te) throws TransferCancelledException {
    ProgressContributor c = contrib;
    if (c == null || handle == null) {
        return;
    }
    TransferResource res = te.getResource();
    int total = (int)Math.min((long)Integer.MAX_VALUE, res.getContentLength());
    if (total < 0) {
        c.start(0);
    } else {
        c.start(total);
    }
    length = total;
    c.progress(TXT_Started(getResourceName(res)));
}
 
Example #3
Source File: ProgressTransferListener.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void transferCorrupted(TransferEvent te) throws TransferCancelledException {
    ProgressContributor c = contrib;
    contrib = null;
    if (c != null) {
        c.finish();
    }
}
 
Example #4
Source File: JULMavenTransferListener.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void transferProgressed(TransferEvent event)
         throws TransferCancelledException
{
   TransferResource resource = event.getResource();
   downloads.put(resource, event.getTransferredBytes());

   StringBuilder buffer = new StringBuilder(64);

   for (Map.Entry<TransferResource, Long> entry : downloads.entrySet())
   {
      long total = entry.getKey().getContentLength();
      Long complete = entry.getValue();
      // NOTE: This null check guards against http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6312056
      if (complete != null)
      {
         buffer.append(getStatus(complete.longValue(), total)).append("  ");
      }
   }

   int pad = lastLength - buffer.length();
   lastLength = buffer.length();
   pad(buffer, pad);
   buffer.append('\r');

   out.info(buffer.toString());
}
 
Example #5
Source File: Plugin.java    From gate-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void transferProgressed(TransferEvent event)
    throws TransferCancelledException {
  fireDownloadProgressed(event.getResource().getFile().getName(),
      event.getResource().getContentLength(), event.getTransferredBytes());

}
 
Example #6
Source File: JULMavenTransferListener.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void transferCorrupted(TransferEvent event)
         throws TransferCancelledException
{
   TransferResource resource = event.getResource();

   out.warning(event.getException().getMessage() + " for " + resource.getRepositoryUrl()
            + resource.getResourceName());
}
 
Example #7
Source File: LogTransferListener.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void transferProgressed(TransferEvent event)
         throws TransferCancelledException
{
   TransferResource resource = event.getResource();
   downloads.put(resource, event.getTransferredBytes());

   StringBuilder buffer = new StringBuilder(64);

   for (Map.Entry<TransferResource, Long> entry : downloads.entrySet())
   {
      long total = entry.getKey().getContentLength();
      Long complete = entry.getValue();
      // NOTE: This null check guards against http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6312056
      if (complete != null)
      {
         buffer.append(getStatus(complete.longValue(), total)).append("  ");
      }
   }

   int pad = lastLength - buffer.length();
   lastLength = buffer.length();
   pad(buffer, pad);
   buffer.append('\r');

   out.print(buffer.toString());
}
 
Example #8
Source File: LogTransferListener.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void transferCorrupted(TransferEvent event)
         throws TransferCancelledException
{
   TransferResource resource = event.getResource();

   out.println("[WARNING] " + event.getException().getMessage() + " for " + resource.getRepositoryUrl()
            + resource.getResourceName());
}
 
Example #9
Source File: JULMavenTransferListener.java    From furnace with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void transferStarted(TransferEvent event) throws TransferCancelledException
{
}
 
Example #10
Source File: LogTransferListener.java    From furnace with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void transferStarted(TransferEvent event) throws TransferCancelledException
{
}
 
Example #11
Source File: LoggerTransferListener.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void transferStarted ( final TransferEvent event ) throws TransferCancelledException
{

}
 
Example #12
Source File: LoggerTransferListener.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void transferProgressed ( final TransferEvent event ) throws TransferCancelledException
{

}
 
Example #13
Source File: LoggerTransferListener.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void transferInitiated ( final TransferEvent event ) throws TransferCancelledException
{
    logger.debug ( "transferInitiated - {}", event );
}
 
Example #14
Source File: LoggerTransferListener.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void transferCorrupted ( final TransferEvent event ) throws TransferCancelledException
{

}
 
Example #15
Source File: ProgressReportingTransferListener.java    From rug-cli with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void transferCorrupted(TransferEvent event) throws TransferCancelledException {
    if (CommandLineOptions.hasOption("noisy")) {
        report(event);
    }
}
 
Example #16
Source File: LoggingTransferListener.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void transferCorrupted( TransferEvent event )
    throws TransferCancelledException
{
  logEvent(event);
}
 
Example #17
Source File: LoggingTransferListener.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void transferProgressed( TransferEvent event )
    throws TransferCancelledException
{
  logEvent(event);
}
 
Example #18
Source File: LoggingTransferListener.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void transferStarted( TransferEvent event )
    throws TransferCancelledException
{
  logEvent(event);
}
 
Example #19
Source File: LoggingTransferListener.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void transferInitiated( TransferEvent event )
    throws TransferCancelledException
{
  logEvent(event);
}
 
Example #20
Source File: Plugin.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void transferCorrupted(TransferEvent event)
    throws TransferCancelledException {
  fireDownloadFailed(event.getResource().getFile().getName(),
      event.getException());
}
 
Example #21
Source File: Plugin.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void transferStarted(TransferEvent event)
    throws TransferCancelledException {
  fireDownloadStarted(event.getResource().getFile().getName());

}
 
Example #22
Source File: Plugin.java    From gate-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void transferInitiated(TransferEvent event)
    throws TransferCancelledException {
  // ignore this one
}