Examples of CheckSums


Examples of org.pokenet.thin.libs.CheckSums

      revision++;
      in.close();
    } catch (Exception e) {
      revision = 1;
    }
    CheckSums s;
    try {
      /* Create checksum for client.jar */
      s = new CheckSums();
      System.out.println("Generating checksums");
      m_files.put("./client.jar", s.getSHA1Checksum("client.jar"));
      /* Create checksum for native libs */
      File f = new File("./lib/native/");
      String [] dir = f.list();
      for(int i = 0; i < dir.length; i++) {
        f = new File("./lib/native/" + dir[i]);
        if(f.isFile()) {
          m_files.put(f.getPath(), s.getSHA1Checksum(f.getPath()));
        }
      }
      /* Create checksum for res */
      f = new File("./res/");
      dir = f.list();
      for(int i = 0; i < dir.length; i++) {
        f = new File("./res/" + dir[i]);
        if(f.isFile()) {
          m_files.put(f.getPath(), s.getSHA1Checksum(f.getPath()));
        } else if(f.isDirectory()) {
          scanDirectory(f.getPath());
        }
      }
      /* Create updates.txt */
 
View Full Code Here

Examples of org.pokenet.thin.libs.CheckSums

  private static void scanDirectory(String directory) throws Exception {
    if(directory.contains(".svn"))
      return;
    File f = new File(directory);
    String [] list = f.list();
    CheckSums s = new CheckSums();
    for(int i = 0; i < list.length; i++) {
      f = new File(directory + "/" + list[i]);
      if(f.isFile()) {
        m_files.put(f.getPath(), s.getSHA1Checksum(f.getPath()));
      } else if(f.isDirectory()) {
        scanDirectory(f.getPath());
      }
    }
  }
View Full Code Here

Examples of org.pokenet.thin.libs.CheckSums

    int total = files.keySet().size();
    int value = 0;
    m_update.setText("Updating (" + value + "/" + total + "): ");
    /* We got the list of checksums, let's see if we need to update */
    Iterator<String> it = files.keySet().iterator();
    CheckSums s;
    while(it.hasNext()) {
      String file = it.next();
      /* First check if we have the file */
      File f = new File(folder + file);
      if(f.exists()) {
        /* It exists, does it need updating? */
        s = new CheckSums();
        String current = "";
        String online = files.get(file);
        try {
          current = s.getSHA1Checksum(f.getPath());
          if(current.compareTo(online) != 0) {
            /* We need to update */
            f.delete();
            f = new File(folder + file);
            f.createNewFile();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.