FilenotFoundException, obwohl die Datei vorhanden ist und der Pfad dazu korrekt ist [doppelt]Java

Java-Forum
Anonymous
 FilenotFoundException, obwohl die Datei vorhanden ist und der Pfad dazu korrekt ist [doppelt]

Post by Anonymous »

Ich schreibe diesen Test: < /p>
private String classPath = "classpath:quote/nb/";

@Test
public void when_invalid_loading_http_bad_request_returned() {
JSONParser jsonParser = new JSONParser();
Object object;

try {
object =
jsonParser.parse(
new FileReader(
classPath
+ "invalid-loading.json"));
JSONObject jsonObject = (JSONObject) object;
JSONObject customer = (JSONObject) jsonObject.get("customer");
String loadPct = (String) customer.get("loadPct");
customer.put("loadPct", "10");
loadPct = (String) customer.get("loadPct");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
fail("PAC ParseException");
}
}
< /code>
Es ist nicht vollständig, aber wenn ich versuche, es auszuführen, erhalte ich: < /p>

java.io.filenotfoundException: ClassPath: Quote \ nb \ ungültig. /> Die Datei existiert und die Schreibweise für den Namen korrekt.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post