Esempio n. 1
0
  @Override
  protected void migrateKeyValue(File theFile) throws Exception {
    if (theFile.getName().equalsIgnoreCase("ProjInfo.xml")) {
      File cogFolder = theFile.getParentFile();
      for (File child : cogFolder.listFiles()) {
        String childName = child.getName();
        if (childName.startsWith("key_")) {
          String fileKey = SectionUtil.sanitize(childName.substring(4));
          setKey(fileKey);
        }
      }
    } else if (theFile.getName().endsWith(".sp")) {
      super.migrateKeyValue(theFile);
    } else {
      throw new Exception("don't know how to make key for " + theFile);
    }

    // debug code to identify why projects are becoming named pageinfo
    if (getKey().equalsIgnoreCase("pageinfo")) {
      throw new Exception(
          "for some reason this page is STILL called pageinfo ... should not be: " + theFile);
    }
  }