Caution :If you choose to get URL object of your resource, the path given by URL.toString() is an encoded URL string. It must be decoded if you want to use as path for File object. This is because some characters, which is valid in path name, has to be encoded for URL, e.g. space bar character is encoded to %20.