java获取当前路径&文件读写

this.getClass().getResource():

参考:https://blog.csdn.net/haoxiaoyong1014/article/details/107452595

>>文件操作:

  File file = File.createTempFile("geoserver", "req");

>>FileOutputStream:

  try (FileOutputStream output = new FileOutputStream(file)) {

    output.write(body.getBytes());

    output.flush();

   }

原文地址:https://www.cnblogs.com/2008nmj/p/15822726.html