示例#1
0
  public final Properties getResourceAsProperties(String sName) {

    Properties p = new Properties();
    try {
      byte[] img = getResourceAsBinary(sName);
      if (img != null) {
        p.loadFromXML(new ByteArrayInputStream(img));
      }
    } catch (IOException e) {
    }
    return p;
  }
示例#2
0
 public final void setResourceAsProperties(String sName, Properties p) {
   if (p == null) {
     setResource(sName, 0, null); // texto
   } else {
     try {
       ByteArrayOutputStream o = new ByteArrayOutputStream();
       p.storeToXML(o, AppLocal.APP_NAME, "UTF8");
       setResource(sName, 0, o.toByteArray()); // El texto de las propiedades
     } catch (IOException e) { // no deberia pasar nunca
     }
   }
 }