I'm trying to include .bin files in my .jar file
this is a function which reads from a file
public Object read(String filepath) throws URISyntaxException{
Object result=null;
try{
ObjectInputStream Reader=new ObjectInputStream(new FileInputStream(new File(this.getClass().getResource("/gui/Files/"+filepath).toURI())));
result = Reader.readObject();
}
catch(IOException e){
System.out.println(e);
}
catch (ClassNotFoundException ex) {
Logger.getLogger(Fmanager.class.getName()).log(Level.SEVERE, null, ex);
}
return result;
}
it works and reads files from this path "\build\classes\gui\Files" Does the file cause problem?? could you tell me what is the problem please!!