Skip to content

Commit 9c63e0f

Browse files
committed
Add new util method.
DEVSIX-1668
1 parent cee74eb commit 9c63e0f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

io/src/main/java/com/itextpdf/io/util/UrlUtil.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,14 @@ public static URL getFinalURL(URL initialUrl) throws IOException {
120120
}
121121
return finalUrl;
122122
}
123+
124+
/**
125+
* This method gets uri string from a file.
126+
* @param filename a given filename
127+
* @return a uri string
128+
*/
129+
public static String getFileUriString(String filename) throws MalformedURLException {
130+
return new File(filename).toURI().toURL().toExternalForm();
131+
}
132+
123133
}

0 commit comments

Comments
 (0)