File tree Expand file tree Collapse file tree
java/src/main/java/com/genexus Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,13 +25,21 @@ private static BufferedImage createBufferedImageFromURI(String filePathOrUrl) th
2525 {
2626 IHttpContext httpContext = com .genexus .ModelContext .getModelContext ().getHttpContext ();
2727 InputStream is = null ;
28+ try {
29+ if (filePathOrUrl .toLowerCase ().startsWith ("http://" ) || filePathOrUrl .toLowerCase ().startsWith ("https://" ) ||
30+ (httpContext .isHttpContextWeb () && filePathOrUrl .startsWith (httpContext .getContextPath ())))
31+ is = new URL (GXDbFile .pathToUrl ( filePathOrUrl , httpContext )).openStream ();
32+ else
33+ IHttpContext httpContext = com .genexus .ModelContext .getModelContext ().getHttpContext ();
34+ InputStream is = null ;
2835 try {
2936 if (filePathOrUrl .toLowerCase ().startsWith ("http://" ) || filePathOrUrl .toLowerCase ().startsWith ("https://" ) ||
3037 (httpContext .isHttpContextWeb () && filePathOrUrl .startsWith (httpContext .getContextPath ())))
3138 is = new URL (GXDbFile .pathToUrl ( filePathOrUrl , httpContext )).openStream ();
3239 else
3340 is = getGXFile (filePathOrUrl ).getStream ();
3441 return ImageIO .read (is );
42+ } catch (IOException e ) {
3543 } catch (IOException e ) {
3644 log .error ("Failed to read image stream: " + filePathOrUrl );
3745 throw e ;
You can’t perform that action at this time.
0 commit comments