1

I have the necessity to convert a SmbFile provided by a server that use the SMB protocol into a java File inside my web application. I try to use various solution, but none of these works fine. Can anyone help me?

jelmer
  • 2,405
  • 14
  • 27
Matteo Rossi
  • 95
  • 3
  • 11
  • Would the answer at http://stackoverflow.com/a/36473193/399435 help? – Karthic Raghupathi Apr 21 '17 at 09:26
  • Which operating system is this on, what did you try, what happened, what did you want to happen – Joni Apr 21 '17 at 09:35
  • I am using a Linux server (Ubuntu distro), and in my webapp I am not able to convert the file inside the server in the Java file format – Matteo Rossi Apr 21 '17 at 09:56
  • What do you mean by "convert" - do you want to download a file from the server? How did the "various solutions" you tried not help you? If you don't say what you tried you will likely get answers that suggest things you already tried and didn't work. – Joni Apr 22 '17 at 07:46

1 Answers1

0

I used Apache Commons IO: to convert smbfile to java file.

InputStream is = smbFile.getInputStream(); File targetFile = new File("yourpath/file.pdf"); FileUtils.copyInputStreamToFile(is, targetFile);

Aung Myat Hein
  • 4,018
  • 1
  • 36
  • 42