Okay, I'm trying to load a file in Java using this code:
String file = "map.mp";
URL url = this.getClass().getResource(file);
System.out.println("url = " + url);
FileInputStream x = new FileInputStream("" + url);
and despite the file being in the same folder as the class it says it can't find it (yes, it is in a try catch block in the full code).
However, it finds another file using the same code with a different name:
URL url = this.getClass().getResource("default.png");
System.out.println("url2 = " + this.getClass().getResource("default.png"));
BufferedImage img = ImageIO.read(url);
Why can't my code find my map.mp file?