Alex Rivera | Logout

How should I load files into my Java application?

Asked 2008-08-09T05:33:22.967
72

How should I load files into my Java application?

Edit
Report

1 Answer

10

getResource is fine, but using relative paths will work just as well too, as long as you can control where your working directory is (which you usually can).

Furthermore the platform dependence regarding the separator character can be gotten around using File.separator, File.separatorChar, or System.getProperty("file.separator").

answered 2008-08-09T07:18:04.550

Your Answer