javaurljunit

Pass a local file in to URL in Java


How do I create a new URL object using a local file, for the purpose of unit tests?


Solution

  • new File(path).toURI().toURL();