This method lists all tasks defined in the file.

@param file MPX file
322179
private static void listTasks(ProjectFile file)
   {
      SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm z");

      for (Task task : file.getTasks())
      {
         Date date = task.getStart();
         String text = task.getStartText();
         String startDate = text != null ? text : (date != null ? df.format(date) : "(no start date supplied)");

         date = task.getFinish();
         text = task.getFinishText();
         String finishDate = text != null ? text : (date != null ? df.format(date) : "(no finish date supplied)");

         Duration dur = task.getDuration();
         text = task.getDurationText();
         String duration = text != null ? text : (dur != null ? dur.toString() : "(no duration supplied)");

         dur = task.getActualDuration();
         String actualDuration = dur != null ? dur.toString() : "(no actual duration supplied)";

         String baselineDuration = task.getBaselineDurationText();
         if (baselineDuration == null)
         {
            dur = task.getBaselineDuration();
            if (dur != null)
            {
               baselineDuration = dur.toString();
            }
            else
            {
               baselineDuration = "(no duration supplied)";
            }
         }

         System.out.println("Task: " + task.getName() + " ID=" + task.getID() + " Unique ID=" + task.getUniqueID() + " (Start Date=" + startDate + " Finish Date=" + finishDate + " Duration=" + duration + " Actual Duration" + actualDuration + " Baseline Duration=" + baselineDuration + " Outline Level=" + task.getOutlineLevel() + " Outline Number=" + task.getOutlineNumber() + " Recurring=" + task.getRecurring() + ")");
      }
      System.out.println();
   }
1250205
private void addResources(MpxjTreeNode parentNode, ProjectFile file)
   {
      for (Resource resource : file.getResources())
      {
         final Resource r = resource;
         MpxjTreeNode childNode = new MpxjTreeNode(resource)
         {
            @Override public String toString()
            {
               return r.getName();
            }
         };
         parentNode.add(childNode);
      }
   }
763898
public static List<File> findAllFile(File file) {
        if (file == null || !file.exists()) {
            return Collections.emptyList();
        }

        if (file.isFile()) {
            return Collections.singletonList(file);
        }

        List<File> fileList = new ArrayList<>();
        File[] files = file.listFiles();
        for (File f : files) {
            fileList.addAll(findAllFile(f));
        }

        return fileList;
    }
412849
public void queueFile (File file, boolean loop)
    {
        try {
            queueURL(file.toURI().toURL(), loop);
        } catch (MalformedURLException e) {
            log.warning("Invalid file url.", "file", file, e);
        }
    }
1221007
private void writeActivity(Task mpxj)
   {
      ActivityType xml = m_factory.createActivityType();
      m_project.getActivity().add(xml);

      Task parentTask = mpxj.getParentTask();
      Integer parentObjectID = parentTask == null ? null : parentTask.getUniqueID();

      xml.setActualStartDate(mpxj.getActualStart());
      xml.setActualFinishDate(mpxj.getActualFinish());
      xml.setAtCompletionDuration(getDuration(mpxj.getDuration()));
      xml.setCalendarObjectId(getCalendarUniqueID(mpxj.getCalendar()));
      xml.setDurationPercentComplete(getPercentage(mpxj.getPercentageComplete()));
      xml.setDurationType(DURATION_TYPE_MAP.get(mpxj.getType()));
      xml.setFinishDate(mpxj.getFinish());
      xml.setGUID(DatatypeConverter.printUUID(mpxj.getGUID()));
      xml.setId(getActivityID(mpxj));
      xml.setName(mpxj.getName());
      xml.setObjectId(mpxj.getUniqueID());
      xml.setPercentComplete(getPercentage(mpxj.getPercentageComplete()));
      xml.setPercentCompleteType("Duration");
      xml.setPrimaryConstraintType(CONSTRAINT_TYPE_MAP.get(mpxj.getConstraintType()));
      xml.setPrimaryConstraintDate(mpxj.getConstraintDate());
      xml.setPlannedDuration(getDuration(mpxj.getDuration()));
      xml.setPlannedFinishDate(mpxj.getFinish());
      xml.setPlannedStartDate(mpxj.getStart());
      xml.setProjectObjectId(PROJECT_OBJECT_ID);
      xml.setRemainingDuration(getDuration(mpxj.getRemainingDuration()));
      xml.setRemainingEarlyFinishDate(mpxj.getEarlyFinish());
      xml.setRemainingEarlyStartDate(mpxj.getResume());
      xml.setRemainingLaborCost(NumberHelper.DOUBLE_ZERO);
      xml.setRemainingLaborUnits(NumberHelper.DOUBLE_ZERO);
      xml.setRemainingNonLaborCost(NumberHelper.DOUBLE_ZERO);
      xml.setRemainingNonLaborUnits(NumberHelper.DOUBLE_ZERO);
      xml.setStartDate(mpxj.getStart());
      xml.setStatus(getActivityStatus(mpxj));
      xml.setType(extractAndConvertTaskType(mpxj));
      xml.setWBSObjectId(parentObjectID);
      xml.getUDF().addAll(writeUDFType(FieldTypeClass.TASK, mpxj));

      writePredecessors(mpxj);
   }
521088
private void postProcessTasks()
   {
      List<Task> allTasks = m_file.getTasks();
      if (allTasks.size() > 1)
      {
         Collections.sort(allTasks);

         int taskID = -1;
         int lastTaskID = -1;

         for (int i = 0; i < allTasks.size(); i++)
         {
            Task task = allTasks.get(i);
            taskID = NumberHelper.getInt(task.getID());
            // In Project the tasks IDs are always contiguous so we can spot invalid tasks by making sure all
            // IDs are represented.
            if (!task.getNull() && lastTaskID != -1 && taskID > lastTaskID + 1)
            {
               // This task looks to be invalid.
               task.setNull(true);
            }
            else
            {
               lastTaskID = taskID;
            }
         }
      }
   }
374420
private void readTasks()
   {
      Integer rootID = Integer.valueOf(1);
      readWBS(m_projectFile, rootID);
      readTasks(rootID);
      m_projectFile.getTasks().synchronizeTaskIDToHierarchy();
   }
1228524
public void loadFile(File file)
   {
      try
      {
         m_projectFile = new UniversalProjectReader().read(file);
         if (m_projectFile == null)
         {
            throw new IllegalArgumentException("Unsupported file type");
         }
      }

      catch (Exception ex)
      {
         throw new RuntimeException(ex);
      }

      MpxjTreeNode projectNode = new MpxjTreeNode(m_projectFile, FILE_EXCLUDED_METHODS)
      {
         @Override public String toString()
         {
            return "Project";
         }
      };

      MpxjTreeNode configNode = new MpxjTreeNode(m_projectFile.getProjectConfig())
      {
         @Override public String toString()
         {
            return "MPXJ Configuration";
         }
      };
      projectNode.add(configNode);

      MpxjTreeNode propertiesNode = new MpxjTreeNode(m_projectFile.getProjectProperties())
      {
         @Override public String toString()
         {
            return "Properties";
         }
      };
      projectNode.add(propertiesNode);

      MpxjTreeNode tasksFolder = new MpxjTreeNode("Tasks");
      projectNode.add(tasksFolder);
      addTasks(tasksFolder, m_projectFile);

      MpxjTreeNode resourcesFolder = new MpxjTreeNode("Resources");
      projectNode.add(resourcesFolder);
      addResources(resourcesFolder, m_projectFile);

      MpxjTreeNode assignmentsFolder = new MpxjTreeNode("Assignments");
      projectNode.add(assignmentsFolder);
      addAssignments(assignmentsFolder, m_projectFile);

      MpxjTreeNode calendarsFolder = new MpxjTreeNode("Calendars");
      projectNode.add(calendarsFolder);
      addCalendars(calendarsFolder, m_projectFile);

      MpxjTreeNode groupsFolder = new MpxjTreeNode("Groups");
      projectNode.add(groupsFolder);
      addGroups(groupsFolder, m_projectFile);

      MpxjTreeNode customFieldsFolder = new MpxjTreeNode("Custom Fields");
      projectNode.add(customFieldsFolder);
      addCustomFields(customFieldsFolder, m_projectFile);

      MpxjTreeNode filtersFolder = new MpxjTreeNode("Filters");
      projectNode.add(filtersFolder);

      MpxjTreeNode taskFiltersFolder = new MpxjTreeNode("Task Filters");
      filtersFolder.add(taskFiltersFolder);
      addFilters(taskFiltersFolder, m_projectFile.getFilters().getTaskFilters());

      MpxjTreeNode resourceFiltersFolder = new MpxjTreeNode("Resource Filters");
      filtersFolder.add(resourceFiltersFolder);
      addFilters(resourceFiltersFolder, m_projectFile.getFilters().getResourceFilters());

      MpxjTreeNode viewsFolder = new MpxjTreeNode("Views");
      projectNode.add(viewsFolder);
      addViews(viewsFolder, m_projectFile);

      MpxjTreeNode tablesFolder = new MpxjTreeNode("Tables");
      projectNode.add(tablesFolder);
      addTables(tablesFolder, m_projectFile);

      m_model.setRoot(projectNode);
   }
975874
public void processFile(File file) {
    TreeReader tr = null;

    // SRL stuff
    CollectionValuedMap<Integer,String> srlMap = null;
    if (this.srlMap != null) {
      // there must be a better way ...
      String filename = file.getAbsolutePath();
      for (String suffix : this.srlMap.keySet()) {
        if (filename.endsWith(suffix)) {
          srlMap = this.srlMap.get(suffix);
          break;
        }
      }
      if (srlMap == null) {
        System.err.println("could not find SRL entries for file: "+file);
      }
    }

    try {
      // maybe print file name to stdout to get some feedback
      if (PRINT_FILENAMES) {
        System.err.println(file);
      }
      // could throw an IO exception if can't open for reading
      tr = treeReaderFactory().newTreeReader(new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding())));
      int sentIndex=0;
      Tree pt;
      while ((pt = tr.readTree()) != null) {
        if (pt.label() instanceof HasIndex) { // so we can trace where this tree came from
          HasIndex hi = (HasIndex) pt.label();
          hi.setDocID(file.getName());
          hi.setSentIndex(sentIndex);
        }
        if (srlMap == null) {
          parseTrees.add(pt);
        } else {
          Collection<String> srls = srlMap.get(sentIndex);
//           pt.pennPrint();
//           System.err.println(srls);
          parseTrees.add(pt);
          if (srls.isEmpty()) {
//            parseTrees.add(pt);
          } else {
            for (String srl : srls) {
//              Tree t = pt.deepCopy();
              String[] bits = srl.split("\\s+");
              int verbIndex = Integer.parseInt(bits[0]);
              String lemma = bits[2].split("\\.")[0];
//              Tree verb = Trees.getTerminal(t, verbIndex);
              Tree verb = Trees.getTerminal(pt, verbIndex);
//              ((CoreLabel)verb.label()).set(SRLIDAnnotation.class, SRL_ID.REL);
              ((CoreLabel)verb.label()).set(CoreAnnotations.CoNLLPredicateAnnotation.class, true);
              for (int i = 4; i < bits.length; i++) {
                String arg = bits[i];
                String[] bits1;
                if (arg.indexOf("ARGM") >= 0) {
                  bits1 = arg.split("-");
                } else {
                  bits1 = arg.split("-");
                }
                String locs = bits1[0];
                String argType = bits1[1];
                if (argType.equals("rel")) {
                  continue;
                }
                for (String loc : locs.split("[*,]")) {
                  bits1 = loc.split(":");
                  int term = Integer.parseInt(bits1[0]);
                  int height = Integer.parseInt(bits1[1]);
//                  Tree t1 = Trees.getPreTerminal(t, term);
                  Tree t1 = Trees.getPreTerminal(pt, term);
                  for (int j = 0; j < height; j++) {
//                    t1 = t1.parent(t);
                    t1 = t1.parent(pt);
                  }
                  Map<Integer,String> roleMap = ((CoreLabel)t1.label()).get(CoreAnnotations.CoNLLSRLAnnotation.class);
                  if (roleMap == null) {
                    roleMap = new HashMap<Integer, String>();
                    ((CoreLabel)t1.label()).set(CoreAnnotations.CoNLLSRLAnnotation.class, roleMap);
                  }
                  roleMap.put(verbIndex, argType);
//                  ((CoreLabel)t1.label()).set(SRLIDAnnotation.class, SRL_ID.ARG);
                }
              }
//               for (Tree t1 : t) {
//                 if (t1.isLeaf()) { continue; }
//                 CoreLabel fl = (CoreLabel)t1.label();
//                 if (fl.value() == null) { continue; }
//                 if (!fl.has(SRLIDAnnotation.class)) {
//                   boolean allNone = true;
//                   for (Tree t2 : t1) {
//                     SRL_ID s = ((CoreLabel)t2.label()).get(SRLIDAnnotation.class);
//                     if (s == SRL_ID.ARG || s == SRL_ID.REL) {
//                       allNone = false;
//                       break;
//                     }
//                   }
//                   if (allNone) {
//                     fl.set(SRLIDAnnotation.class, SRL_ID.ALL_NO);
//                   } else {
//                     fl.set(SRLIDAnnotation.class, SRL_ID.NO);
//                   }
//                 }
//               }
//              parseTrees.add(t);
            }
          }
        }

        sentIndex++;
      }
    } catch (IOException e) {
      System.err.println("loadTree IO Exception: " + e + " in file " + file);
    } finally {
      try {
        if (tr != null) {
          tr.close();  // important: closes file even if error!
        }
      } catch (IOException e) {
        // do nothin'
      }
    }
  }
59746
private static void listResources(ProjectFile file)
   {
      for (Resource resource : file.getResources())
      {
         System.out.println("Resource: " + resource.getName() + " (Unique ID=" + resource.getUniqueID() + ") Start=" + resource.getStart() + " Finish=" + resource.getFinish());
      }
      System.out.println();
   }
898137
private void readTasks(Project plannerProject) throws MPXJException
   {
      Tasks tasks = plannerProject.getTasks();
      if (tasks != null)
      {
         for (net.sf.mpxj.planner.schema.Task task : tasks.getTask())
         {
            readTask(null, task);
         }

         for (net.sf.mpxj.planner.schema.Task task : tasks.getTask())
         {
            readPredecessors(task);
         }
      }

      m_projectFile.updateStructure();
   }
668180
private void dealWithFile(File file) {
		// Browse thru Map
		SelectiveFileScannerObserver specificFileScanner = selectiveFileScannerMap.get(file.getName());
		if (specificFileScanner != null) {
			logger.debug("Launching fileScanner={} for file={}", specificFileScanner.getClass(), file.getAbsoluteFile());
			specificFileScanner.scanFile(file);
		}

		// Browse thru List
		for (FileScannerObserver fileScanner : fileScanners) {
			logger.debug("Launching fileScanner={} for file={}", fileScanner.getClass(), file.getAbsoluteFile());
			fileScanner.scanFile(file);
		}
	}
82486
private void mapAndRememberIndexFile(File index) {
        MappedFileReader idxFileReader = null;
        try {
            idxFileReader = new MappedFileReader(index);
            mappedIndexFileReader.add(idxFileReader);
            indexFiles.add(idxFileReader.map());
        } catch(IOException e) {
            logger.error("Error mmapping " + index, e);
        }
    }
928886
private static void listTaskNotes(ProjectFile file)
   {
      for (Task task : file.getTasks())
      {
         String notes = task.getNotes();

         if (notes.length() != 0)
         {
            System.out.println("Notes for " + task.getName() + ": " + notes);
         }
      }

      System.out.println();
   }
478577
private void listFiles(File dir, List<File> results) {
        File[] found = dir.listFiles();
        if ( found != null ) {
            for ( File f : found ) {
                if (f.isDirectory()) {
                	//do nothing
                } else {
                    results.add(f);
                }
            }
        }
    }
67526
public static String[] list(final File file) {
        return AccessController.doPrivileged(new PrivilegedAction<String[]>() {
            @Override
            public String[] run() {
                return file.list();
            }
        });
    }
780309
private void processProjectProperties() throws MPXJException
   {
      ProjectPropertiesReader reader = new ProjectPropertiesReader();
      reader.process(m_file, m_projectProps, m_root);
   }