Package com.gi.engine.carto

Examples of com.gi.engine.carto.MapDescFile


      } catch (Exception ex) {
        ex.printStackTrace();
      }

      try {
        MapDescFile mapDescFile = new MapDescFile(this
            .getMapDescFilePath());
        mapDesc = mapDescFile.open();
        if (mapDesc == null) {
          String password = JOptionPane
              .showInputDialog("Is the file has a password?");
          if (password != null && !"".equals(password)) {
            MessageDigest md = null;
            try {
              md = MessageDigest.getInstance("MD5");
            } catch (NoSuchAlgorithmException e) {
              e.printStackTrace();
            }
            byte[] md5password = md.digest(password.getBytes());
            BASE64Encoder encoder = new BASE64Encoder();
            String base64md5password = encoder.encode(md5password);
            mapDesc = mapDescFile.open(base64md5password);
          }
        }

        if (mapDesc != null) {
          map.initByMapDesc(mapDesc, this.getMapDescFilePath());
View Full Code Here


  private void saveMapDescFile() {
    try {
      String password = JOptionPane
          .showInputDialog("Input encrypt password, no encrypt if leave it blank.");
      MapDescFile file = new MapDescFile(this.getMapDescFilePath());
      if (password != null && "".equals(password.trim())) {
        if (file.save(mapDesc)) {
          JOptionPane.showMessageDialog(this, "Save success!");
        }
      } else if (password != null && !"".equals(password.trim())) {
        if (file.save(mapDesc, password)) {
          JOptionPane.showMessageDialog(this, "Save success!");
        }
      }
    } catch (Exception ex) {
      JOptionPane.showMessageDialog(this,
View Full Code Here

    MapServiceDescFile mapServiceDescFile = new MapServiceDescFile(
        serviceDirAbsolutePath
            + ArchitectureUtil.MAP_SERVICE_DESC_FILE_NAME);
    mapServiceDesc = (MapServiceDesc) mapServiceDescFile.open();

    MapDescFile mapDescFile = new MapDescFile(serviceDirAbsolutePath
        + ArchitectureUtil.MAP_DESC_FILE_NAME);
    String password = mapServiceDesc.getPassword();
    if (password == null || "".equals(password.trim())) {
      mapDesc = mapDescFile.open();
    } else {
      mapDesc = mapDescFile.open(password);
    }

    if (mapServiceDesc.isAutoStart()) {
      start();
    }
View Full Code Here

TOP

Related Classes of com.gi.engine.carto.MapDescFile

Copyright © 2018 www.massapicom. 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.