Skip to content

Commit d14d440

Browse files
committed
Add new util method.
DEVSIX-1668
1 parent d4f18b9 commit d14d440

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
@@ -117,4 +117,14 @@ public static URL getFinalURL(URL url) throws IOException {
117117
}
118118
return url;
119119
}
120+
121+
/**
122+
* This method gets uri string from a file.
123+
* @param filename a given filename
124+
* @return a uri string
125+
*/
126+
public static String getFileUriString(String filename) throws MalformedURLException {
127+
return new File(filename).toURI().toURL().toExternalForm();
128+
}
129+
120130
}

0 commit comments

Comments
 (0)