Convert UsbFile to Java type File

2020-02-11 12:07发布

I am using libaums and I read file from USB. All files as a UsbFile type. I want send my file to FTP. When I send FTP need use FileInputStream ant thos have parameter File. How can I convert?

1条回答
Evening l夕情丶
2楼-- · 2020-02-11 12:18

I think I answered this now a couple of times, at different places. There is simply no way to "convert" a UsbFile into a java.io.File. They are just completely different things. What you want to do is to use the UsbFileInputStream. Your FTP library (whichever it is..) should be able to handle a generic InputStream instead of only FileInputStreams.

查看更多
登录 后发表回答