public URL uploadFile ( File file , UploadProgressListener listener ) throws InterruptedException , XMPPException . XMPPErrorException , SmackException , IOException { if ( ! file . isFile ( ) ) { throw new FileNotFoundException ( "The path " + file . getAbsolutePath ( ) + " is not a file" ) ; } final Slot slot = requestSlot ( file . getName ( ) , file . length ( ) , "application/octet-stream" ) ; uploadFile ( file , slot , listener ) ; return slot . getGetUrl ( ) ; }
Request slot and uploaded file to HTTP file upload service with progress callback .