Skip to content

Commit

Permalink
Added support for absolute path in HTML services.
Browse files Browse the repository at this point in the history
  • Loading branch information
ylussaud committed Aug 21, 2024
1 parent 2d19c51 commit d5a3c1e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.awt.Color;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -1685,7 +1686,16 @@ private int getRelativeSize(String imageSize) {
* @return the converted URI
*/
private URI toURI(URI baseURI, String uri) {
return URI.createURI(uri.replace('\\', '/')).resolve(baseURI);
final URI res;

final File file = new File(uri);
if (file.isAbsolute()) {
res = URI.createFileURI(uri);
} else {
res = URI.createURI(uri.replace('\\', '/')).resolve(baseURI);
}

return res;
}

/**
Expand Down

0 comments on commit d5a3c1e

Please sign in to comment.