I'm uploading a file using primefaces components.
public void handleFileUpload(FileUploadEvent event) {
UploadedFile file = event.getFile();
}
For the further progress of the application, I have a function given from a library that I have to use. This function is only accepting a FileObject as input parameter.
How can I convert the UploadedFile (primefaces) to a FileObject (Apache Common)?
A workaround would be converting the UploadedFile to a File and then convert the file to a FileObject using VFS.getManager()
and its functions. But to do this, I would have to save the file on the server and delete it later again.
I'm looking for a way, where I can convert the UploadedFile directly to a FileObject. Maybe by converting it to a bytearray first?
Glad for all suggestions.