No absolute paths
I'm not entirely sure, but I think it would be better to have all resources loaded as resourcestream, without absolute paths. A few things depend on absolute path. OptionsJson uses
JSONObject fileJSON = (JSONObject) (parser.parse(FileSystem.readFromFile(filePaths.get(i))));
There are some solutions which uses Apache's commons io, which I think are easiest. ResourceStream seems to me to have some strange edge cases, when used inside an IDE.
Comments (9)
-
reporter -
reporter -
assigned issue to
-
assigned issue to
-
reporter quote @desrever "IIRC getResourceAsStream() by default is relative to the class's package." "We should move to resourcestreams wherever we can"
-
reporter The best IMO would be to put resource under source, as in the standard layout of Maven.
http://stackoverflow.com/questions/19414453/how-to-get-resources-directory-path-programmatically
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
-
reporter - changed milestone to 0.3.1 - Price-feed streaming service implementation
-
reporter - changed status to resolved
revisit later if necessary
-
- changed milestone to 0.2.1 - Price-feed streaming service implementation
-
- changed milestone to 0.3.1 - Price-feed streaming service implementation
-
- changed milestone to 0.3.1 - Price-feed streaming service implementation&integration
- Log in to comment
http://stackoverflow.com/questions/1464291/how-to-really-read-text-file-from-classpath-in-java
http://stackoverflow.com/questions/6068197/utils-read-resource-text-file-to-string-java