开发者

Changing the path of getClass().getResourceAsStream(PATH) in runtime

Is it possible to change the PATH of the Java code getClass().getResourceAsStream(PATH) in ru开发者_Python百科ntime? I would like to have an edit box so that the user can specify i.e http://site.com/image.png for the PATH.


You shouldn't use getClass().getResourceAsStream() if the resource is not on the classpath (i.e., not deployed on your server). It is not what it is intended for.

To load resources from a HTTP URL, use HttpURLConnection

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜