How do I access a text file from within my war

后端 未结 4 662
清酒与你
清酒与你 2020-12-10 08:42

How do I know what file reference to use to get a file from my WAR.

The structure of the WAR is:

WAR
src
- model
- web

4条回答
  •  無奈伤痛
    2020-12-10 09:32

    The safest way to access this file should be something like this:

    InputStream input = getClass().getClassLoader().getResourceAsStream("your/path/enter/here");

提交回复
热议问题