InputStream is = this.getClass().getResourceAsStream(propsfile);
InputStream is = null; ServletContext ctx = globalconfiguration.getServletContext(); if (ctx != null) { is = ctx.getResourceAsStream(propsfile); } else { is = this.getClass().getResourceAsStream(propsfile); }
    private void init(GlobalConfiguration globalconfiguration) throws IOException {        if(languages == null){            // Get available languages.            availablelanguages=null;                        String availablelanguagesstring = globalconfiguration.getAvailableLanguagesAsString();            availablelanguages =  availablelanguagesstring.split(",");            for(int i=0; i < availablelanguages.length;i++){                availablelanguages[i] =  availablelanguages[i].trim().toUpperCase();            }            // Load availabe languages            languages = new LanguageProperties[availablelanguages.length];            for(int i = 0; i < availablelanguages.length; i++){                languages[i] = new LanguageProperties();                String propsfile = "/" + globalconfiguration.getLanguagePath() + "/"                + globalconfiguration.getLanguageFilename() + "."                + availablelanguages[i].toLowerCase() +".properties";                InputStream is = this.getClass().getResourceAsStream(propsfile);                          if(is==null) {                    //if not available as stream, try it as a file                    is = new FileInputStream("/tmp"+propsfile);                }                languages[i].load(is);            }        }    }