These are the valid file uri:
file:/C:/a.txt <- On Windows
file:///C:/a.txt <- On Windows
file:///home/user/a.txt <- On Linux
So you will need to remove file:/
or file:///
for Windows and file://
for Linux.
More Related Contents:
- Registering and using a custom java.net.URL protocol
- Android: how to parse URL String with spaces to URI object?
- Parse a URI String into Name-Value Collection
- How to construct a relative path in Java from two absolute paths (or URLs)?
- Parsing query strings on Android
- URL to load resources from the classpath in Java
- Java – How to find the redirected url of a url?
- Java – class.getResource returns null
- Get domain name from given url
- Why does PDF is not able to upload in PHP API for Android Pie, Q and R using Retrofit 2 in Android/Java? [Not solved]
- How to access resources in JAR file?
- Getting URL parameter in java and extract a specific text from that URL
- Getting filesystem path of class being executed [duplicate]
- Pass a local file in to URL in Java
- Get filepath and filename of selected gallery image in Android
- Java JTree directory structure from file paths
- Check if file exists on remote server using its URL [duplicate]
- What’s the difference between a Resource, URI, URL, Path and File in Java?
- How to pass a URI to an intent?
- Java HttpServletRequest get URL in browsers URL bar
- How to escape the backslashes and the automatically generated escape character in file path in java
- Get file name from URL
- java.net.URL read stream to byte[]
- Determining location of JVM executable during runtime
- How to deal with the URISyntaxException
- How do I delete files programmatically on Android?
- @PathVariable in SpringBoot with slashes in URL
- Java: how to get a File from an escaped URL?
- URL parsing in Java
- How to load a folder from a .jar?