1 package sample.amazon.amazonSimpleQueueService.util; 2 3 import java.io.InputStream ; 4 import java.util.Properties ; 5 6 23 public class QueueManager { 24 private static String key = null; 25 26 static{ 27 Class clazz = new Object ().getClass(); 28 InputStream stream = clazz.getResourceAsStream("/sample/amazon/common/conf/key.properties"); 29 Properties properties = new Properties (); 30 try { 31 properties.load(stream); 32 key = properties.getProperty("key"); 33 } catch (Exception e) { 34 e.printStackTrace(); 35 } 36 37 } 38 39 public static String getKey() { 40 return key; 41 } 42 43 public synchronized static void setKey(String tkey){ 44 key = tkey; 45 } 46 } 47 | Popular Tags |