Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
Cannot create FileTransferManager object

I am trying to implement file transfer in my project but cannot create FileTransferManager object it says:

FileTransferManager (org.jivesoftware.smack.Connection) in FileTransferManager cannot be applied to (org.jivesoftware.smack.tcp.XMPPTCPConnection)

Here is my code:

 FileTransferManager manager = new FileTransferManager(connection);
            // Where connection is an object of XMPPTCPConnection

Using Smack 4.2.0 and Openfire server

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

The problem could be the version of the smack jar. With a recent version, such as 3.2.1 it should work.

over 4 years ago · Santiago Trujillo Relatório

0

If we are talking about the class org.jivesoftware.smackx.filetransfer.FileTransferManager it has no public constructor however it has a static factory method:

public static synchronized FileTransferManager getInstanceFor(XMPPConnection connection)

so i would try the following:

FileTransferManager manager = FileTransferManager.getInstanceFor(connection);

Are you sure that you imported a right class? Because you shouldn't be able to call its constructor at all.

over 4 years ago · Santiago Trujillo Relatório

0

You may use getDefaultFileTransferManager to achieve it :

public static FileTransferManager getDefaultFileTransferManager(FileTransferAuth fileTransferAuth)
                                                     throws ClientException,
                                                            ServiceException

reference:official doc for Class FileTransferManager

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda