I am trying to upload files by ftp using the apache common library. I want to keep those file inside the jar, since these are files that will stay the same and need to be uploaded on the different hosts several time.
I am trying the following:
public void doCGIRecovery() throws IOException{
System.out.println(getClass().getResource("/cgi/example").getPath());
FileInputStream file = new FileInputStream(getClass().getResource("/cgi/example").getPath());
f.storeFile("./", file);
}
Using eclipse this works and the sysout is giving me:
/Users/user/Documents/workspace/example-Project/bin/com/example/java/example/business/cgi/example
But after the compilation into a jar it returns me the following:
file:/Users/user/Desktop/example.jar!/com/example/java/example/business/cgi/example
And I get (No such file or directory).
So how does that come? Further where does the "!" after example.jar come from?
Best Regards