remove physical file when setFile(null), return null if file is empty