How can I typecast Html5File type object to java.io.File type object?

How can I typecast Html5File type object to java.io.File type object?

public void drop(DragAndDropEvent dropEvent) {

WrapperTransferable tr = (WrapperTransferable) dropEvent.getTransferable();
Html5File files = tr.getFiles();
if (files != null) {
for (final Html5File html5File : files) {
final String fileName = html5File.getFileName();

final ByteArrayOutputStream bas = new ByteArrayOutputStream();
StreamVariable streamVariable = new StreamVariable() {

public OutputStream getOutputStream() {
return bas;
}
public boolean listenProgress() {
return false;
}
public void onProgress(StreamingProgressEvent event) {
}
public void streamingStarted(
StreamingStartEvent event) {
}
public void streamingFinished(
StreamingEndEvent event) {
progress.setVisible(false);
showFile(fileName, html5File.getType(), bas);
}
public void streamingFailed(
StreamingErrorEvent event) {
progress.setVisible(false);
}
public boolean isInterrupted() {
return false;
}
};
html5File.setStreamVariable(streamVariable);
progress.setVisible(true);

encryptAndUploadFile( html5File*, fileName, folderName);

// How can I convert this html5File to java.io.File because I have one encryptAndUploadFile method which accepts file //Parameter
}
}
}

// encryptAndUploadFile() Method
public void encryptAndUploadFile(File file, String fileName,String folderName)
{
String m_strWebFilePath = finalSourcepath + fileName;
File m_objFile=null;
byte sourceFileByte = Encryption.aesEncrypt(com.saterisystems.common.utils.FileUtils.getImageIntoByteArray(file), GlobalConstants.KEY.getBytes(), GlobalConstants.IV.getBytes());


The classes are not directly compatible, so you need to create a temporary file. Create the temp file and write the contents from your ByteArrayOutputStream into the file. Remember to remove the temporary file after you have called encryptAndUpload().