Skip to content

Commit

Permalink
allow "." character in name of ResourceReader resources (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdahlke authored Nov 7, 2023
1 parent 048495b commit b9dccda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/emissary/util/io/ResourceReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public String getResourceName(Class<?> c) {
* Get the resource name
*/
public String getResourceName(Package pkg, String name) {
return (pkg.getName() + "/" + name).replace('.', '/');
return (pkg.getName().replace('.', '/') + "/" + name);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/test/java/emissary/util/io/ResourceReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void testNaming() {
assertEquals("emissary/util/Version.cfg", rr.getConfigDataName(Version.class), "Resource config naming");
assertEquals("emissary/util/io/foo", rr.getResourceName(this.getClass().getPackage(), "foo"), "Resource package naming");
assertEquals("emissary/util/io/foo.xml", rr.getXmlName(this.getClass().getPackage(), "foo"), "Resource package naming");
assertEquals("emissary/util/io/sample.dat", rr.getResourceName(this.thisPackage, "sample.dat"), "Sample file with extension naming");
}

}

0 comments on commit b9dccda

Please sign in to comment.