I am trying to create a temp file in a specific folder In the image below, you can find the structure tree of my project. I am currently in FileAnalyse.java and trying to create the file in data, under webcontent. The following tries did not work for me:
File dir = new File(System.getProperty("user.dir")+"/WebContent/data");
File subjectFile = File.createTempFile("subjects", ".json",dir);
or
File dir = new File("/WebContent/data");
File subjectFile = File.createTempFile("subjects", ".json",dir);

File dir = new File("../WebContent/data");I'm not sure if this works, but usually with..you can get one step back in the folder hierarchy. So because of your packages it could beFile dir = new File("../../../../WebContent/data"); //src/com/packages/rdf need to be gone back