Skip to content

Commit

Permalink
CHAT-593 Avoid reading version each HTTP call (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker authored and Thomas Delhoménie committed Jan 18, 2017
1 parent 44dde4b commit 9e43466
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@ApplicationScoped
public class BundleService {

private static String version;

Map<String, String> resourceBundles = new HashMap<String, String>();

@Ajax
Expand Down Expand Up @@ -59,9 +61,12 @@ public String getBundle(String target, ResourceBundle bundle, Locale locale) {

private static String getVersion()
{
if(version != null) {
return version;
}
InputStream inputStream = BundleService.class.getClassLoader().getResourceAsStream("/META-INF/MANIFEST.MF");

String version = "N/A";
version = "N/A";
try {
Manifest manifest = new Manifest(inputStream);
Attributes attributes = manifest.getMainAttributes();
Expand Down

0 comments on commit 9e43466

Please sign in to comment.