I'm trying to read and write to a file but I'd like to access that file via Resource.
This is what I do
File f = new File(ClassLoader.getSystemResource("/blah/blah/Properties.prop").toURI());
BufferedReader br = new BufferedReader(new FileReader(f));
String line = br.readLine();
PrintWriter p = new PrintWriter(new File(ClassLoader.getSystemResource("/blah/blah/Properties.prop").toURI()));
but neither seems correct. What is the correct way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…