Code example for URI

Methods: toASCIIString

0
        if (!absolutePath.startsWith("/")) {
            absolutePath = "/" + absolutePath;
        } 
 
        try { 
            URI uri = new URI("file", "", absolutePath.replace("\\", "/"), null);
            return uri.toASCIIString();
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Failed to build URI for test file", e);
        } 
    } 
     
    public String getFilePath() {
        return htmlFile.getPath();
    } 
 
    public String getFileURL() {
        return testPageUrl;
    } 
 
}