How to create a file in src/main/resources

前端 未结 4 1155
盖世英雄少女心
盖世英雄少女心 2021-01-23 12:42

If I do this

fis = new FileInputStream(new File(\".\").getAbsolutePath() + \"/sudoinput.txt\");

Its trying to write to this location on the ser

4条回答
  •  醉梦人生
    2021-01-23 13:15

    If you like to create files in webapps/sudoku/WEB-INF/classes which is in the end within the created WAR file which can be achieved by putting the files you want into src/main/resources/ This means in other words you need to create the folder src/main/resources and put the files you like into this directory.

提交回复
热议问题