Fixed if folder doesn't exist, fail to save file.

Format code use Android style.