AnsweredAssumed Answered

Smack 4.2 custom StreamInitiation not supported and FileTransferManager cannot be inherited

Question asked by Erik on Aug 16, 2017

Hi

 

As stated in the title, I am trying to inherit FileTransferManager since I am constructing custom StreamInitiation (for additional data to be sent by si) and FileTransfeRequest. However, the 'FileTransferManager' is set to final in 4.2.0 so I could not inherit it and pass my custom FileTransferRequest to  FileTransferListener's fileTransferRequest() method. I am using the custom FileTransferRequest to retrieve the custom SI object and further get the properties I wanted.

 

Is there any way to do this without inherit the 'FileTransferManager' but still using my custom SI and FileTransferRequest ?.

 

P.S.  I have tried to copy/paste all the associated files in smackx.filetransfer into my own project and refactored some of them to fit my custom SI but it still not work.

My file transfer is using IBB and when it goes to 'initiateIncomingStream' method, the following blocks of code (originally from StreamNegotiator's initiateIncomingStream method) gives the variable streamMethodInitiation a null value:

 

 

 

 

try {  
  streamMethodInitiation = initationSetEvents.performActionAndWaitForEvent(eventKey, connection.getReplyTimeout(), new EventManger.Callback<NotConnectedException>() {  
   @Override  
   public void action() throws NotConnectedException {  
   try {  
   connection.sendStanza(response);  
   }  
   catch (InterruptedException e) {  
   // Ignore  
   }  
  }  
  });  
}  
catch (InterruptedException e) {  
// TODO remove this try/catch once merged into 4.2's master branch  
   throw new IllegalStateException(e);  
}  

 

 

Anyone encounters this kind of problem or anyone have any idea about this?

 

 

Cheers,

Erik

Outcomes