public static void applyFlavorFromPropertiesFile(string paramString) { try { Stream inputStream = ClassLoader.getSystemResource(paramString + ".properties").openStream(); Properties properties = new Properties(); properties.load(inputStream); foreach (string str in properties.Keys) { (Instance).o_rb.setProperty(str, properties.getProperty(str)); } inputStream.Close(); } catch (Exception exception) { Console.WriteLine(exception.ToString()); Console.Write(exception.StackTrace); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private UICountries() throws Exception private UICountries() { Stream inputStream = null; try { inputStream = ClassLoader.getSystemResource("countries.properties").openStream(); if (inputStream == null) { throw new Exception(); } } catch (Exception) { File file = new File(NamingUtil.Instance.getSarPath("countries.properties")); inputStream = new FileStream(file, FileMode.Open, FileAccess.Read); } this.o_rb = new PropertyResourceBundle(inputStream); }
private static URL grammarNameToURL(URL url, string text) { text = String.instancehelper_replace(text, '.', '/'); StringBuilder stringBuilder = new StringBuilder(); if (url != null) { stringBuilder.append(url); if (stringBuilder.charAt(stringBuilder.length() - 1) != '/') { stringBuilder.append('/'); } } stringBuilder.append(text).append(".gram"); string text2 = stringBuilder.toString(); URL url2; try { url2 = new URL(text2); } catch (MalformedURLException) { goto IL_62; } return(url2); IL_62: url2 = ClassLoader.getSystemResource(text2); if (url2 == null) { string text3 = text2; throw new MalformedURLException(text3); } return(url2); }