Ignore:
Timestamp:
May 3, 2011, 8:25:38 PM (13 years ago)
Author:
mlg
Message:

Adds support for changing level on addSimple.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Tools.java

    r10714 r10749  
    366366    public static void setStringValueDom(Element element, String tagName, String value) {
    367367        Element el = (Element) element.getElementsByTagName(tagName).item(0);
    368         el.setNodeValue(value);
     368        el.setTextContent(value);
    369369    }
    370370
     
    387387        }
    388388    }
     389    //
     390    //    /**
     391    //     * Function used to get the md5 sum of a file
     392    //     * @param fileToTest the file
     393    //     * @return the md5 sum
     394    //     * @throws NoSuchAlgorithmException
     395    //     * @throws FileNotFoundException
     396    //     * @throws JiwigoException
     397    //     */
     398    //    public static String getMD5Sum(File file) throws NoSuchAlgorithmException, JiwigoException, FileNotFoundException {
     399    //  MessageDigest digest = MessageDigest.getInstance("MD5");
     400    //  InputStream is = new FileInputStream(file);
     401    //  byte[] buffer = new byte[8192];
     402    //  int read = 0;
     403    //  try {
     404    //      while ((read = is.read(buffer)) > 0) {
     405    //          digest.update(buffer, 0, read);
     406    //      }
     407    //      byte[] md5sum = digest.digest();
     408    //      BigInteger bigInt = new BigInteger(1, md5sum);
     409    //      String output = bigInt.toString(16);
     410    //      return output;
     411    //  } catch (IOException e) {
     412    //      throw new JiwigoException("Unable to process file for MD5", e);
     413    //  } finally {
     414    //      try {
     415    //          is.close();
     416    //      } catch (IOException e) {
     417    //          throw new JiwigoException("Unable to close input stream for MD5 calculation", e);
     418    //      }
     419    //  }
     420    //    }
     421
    389422}
Note: See TracChangeset for help on using the changeset viewer.