public void restoreFile ( File destination ) throws IOException { String nameAsStored = readUTF ( ) ; long lengthAtStoreTime = readLong ( ) ; File storedFile = new File ( getAuxiliaryDirectory ( ) , nameAsStored ) ; FileUtils . copyFile ( storedFile , destination , lengthAtStoreTime ) ; }
Restore a file from storage using the name and length info on the serialization stream and the file from the current auxiliary directory to the given File .