How to create a file in src/main/resources

前端 未结 4 1154
盖世英雄少女心
盖世英雄少女心 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:25

    You can keep the file created under resources and call .class.getresource(your_file_name_or_path_separated_with_forward_slash);

    See if it works for you.

提交回复
热议问题