~ubuntu-branches/debian/sid/wagon2/sid

« back to all changes in this revision

Viewing changes to wagon-providers/wagon-ssh-common-test/src/main/java/org/apache/maven/wagon/providers/ssh/ScpCommand.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2015-09-02 23:46:43 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20150902234643-byu832r11djlzjbs
Tags: 2.9-1
* Team upload.
* New upstream release
  - Refreshed the patches
* Removed the build dependency on libmaven-enforcer-plugin-java
* No longer build and install the unused wagon-scm and wagon-ssh modules
  to reduce the dependencies of libwagon2-java.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    implements Command, Runnable, FileSystemAware
49
49
{
50
50
 
51
 
    protected static final Logger log = LoggerFactory.getLogger( ScpCommand.class );
 
51
    protected static final Logger LOG = LoggerFactory.getLogger( ScpCommand.class );
52
52
 
53
53
    protected static final int OK = 0;
54
54
 
87
87
    public ScpCommand( String[] args )
88
88
    {
89
89
        name = Arrays.asList( args ).toString();
90
 
        if ( log.isDebugEnabled() )
 
90
        if ( LOG.isDebugEnabled() )
91
91
        {
92
 
            log.debug( "Executing command {}", name );
 
92
            LOG.debug( "Executing command {}", name );
93
93
        }
94
94
        path = ".";
95
95
        for ( int i = 1; i < args.length; i++ )
118
118
                        case 'd':
119
119
                            optD = true;
120
120
                            break;
121
 
//                          default:
 
121
                        default:
122
122
//                            error = new IOException("Unsupported option: " + args[i].charAt(j));
123
123
//                            return;
124
124
                    }
307
307
            {
308
308
                // Ignore
309
309
            }
310
 
            log.info( "Error in scp command", e );
 
310
            LOG.info( "Error in scp command", e );
311
311
        }
312
312
        finally
313
313
        {
321
321
    protected void writeDir( String header, SshFile path )
322
322
        throws IOException
323
323
    {
324
 
        if ( log.isDebugEnabled() )
 
324
        if ( LOG.isDebugEnabled() )
325
325
        {
326
 
            log.debug( "Writing dir {}", path );
 
326
            LOG.debug( "Writing dir {}", path );
327
327
        }
328
328
        if ( !header.startsWith( "D" ) )
329
329
        {
385
385
    protected void writeFile( String header, SshFile path )
386
386
        throws IOException
387
387
    {
388
 
        if ( log.isDebugEnabled() )
 
388
        if ( LOG.isDebugEnabled() )
389
389
        {
390
 
            log.debug( "Writing file {}", path );
 
390
            LOG.debug( "Writing file {}", path );
391
391
        }
392
392
        if ( !header.startsWith( "C" ) )
393
393
        {
428
428
        {
429
429
            ack();
430
430
 
431
 
            byte[] buffer = new byte[8192];
 
431
            byte[] buffer = new byte[8 * 1024];
432
432
            while ( length > 0 )
433
433
            {
434
434
                int len = (int) Math.min( length, buffer.length );
475
475
    protected void readFile( SshFile path )
476
476
        throws IOException
477
477
    {
478
 
        if ( log.isDebugEnabled() )
 
478
        if ( LOG.isDebugEnabled() )
479
479
        {
480
 
            log.debug( "Reading file {}", path );
 
480
            LOG.debug( "Reading file {}", path );
481
481
        }
482
482
        StringBuilder buf = new StringBuilder();
483
483
        buf.append( "C" );
494
494
        InputStream is = path.createInputStream( 0 );
495
495
        try
496
496
        {
497
 
            byte[] buffer = new byte[8192];
 
497
            byte[] buffer = new byte[8 * 1024];
498
498
            for (; ; )
499
499
            {
500
500
                int len = is.read( buffer, 0, buffer.length );
516
516
    protected void readDir( SshFile path )
517
517
        throws IOException
518
518
    {
519
 
        if ( log.isDebugEnabled() )
 
519
        if ( LOG.isDebugEnabled() )
520
520
        {
521
 
            log.debug( "Reading directory {}", path );
 
521
            LOG.debug( "Reading directory {}", path );
522
522
        }
523
523
        StringBuilder buf = new StringBuilder();
524
524
        buf.append( "D" );
571
571
            case OK:
572
572
                break;
573
573
            case WARNING:
574
 
                log.warn( "Received warning: " + readLine() );
 
574
                LOG.warn( "Received warning: " + readLine() );
575
575
                break;
576
576
            case ERROR:
577
577
                throw new IOException( "Received nack: " + readLine() );