You should debug. Step trough your code with the debugger and check what is happening.
Random thing that might be happening, but we have no way of knowing for sure: If "source" doesn't exist, you will create dest
, but because source.exists()
will return false,you don't do anything after that. You'll end up with the current behaviour, a newly created file without contents.