@Test public void testPeek_NotFound() throws Exception { try { transporter.peek( new PeekTask( URI.create( "repo/missing.txt" ) ) ); fail( "Expected error" ); } catch ( HttpResponseException e ) { assertEquals( 404, e.getStatusCode() ); assertEquals( Transporter.ERROR_NOT_FOUND, transporter.classify( e ) ); } }
public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ); }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ); int classify( Throwable error ); }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ); int classify( Throwable error );  }