@Test public void testPut_StartCancelled() throws Exception { RecordingTransportListener listener = new RecordingTransportListener(); listener.cancelStart = true; PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); try { transporter.put( task ); fail( "Expected error" ); } catch ( TransferCancelledException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } assertEquals( 0, listener.dataOffset ); assertEquals( 6, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertFalse( new File( repoDir, "file.txt" ).exists() ); }
public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; }
FileTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } }
FileTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } FileTransporter( RemoteRepository repository, Logger logger ); }
FileTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } FileTransporter( RemoteRepository repository, Logger logger ); int classify( Throwable error ); }
FileTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof ResourceNotFoundException ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } FileTransporter( RemoteRepository repository, Logger logger ); int classify( Throwable error );  }