private void receiveStream ( OutputStream out ) { new Thread ( ( ) -> { try { con . receiveData ( out ) ; con . sendResponse ( 226 , "File received!" ) ; } catch ( ResponseException ex ) { con . sendResponse ( ex . getCode ( ) , ex . getMessage ( ) ) ; } catch ( Exception ex ) { con . sendResponse ( 451 , ex . getMessage ( ) ) ; } } ) . start ( ) ; }
Receives a stream asynchronously sending a response after it s done