code: public static final List<String> listProjectNames(File directory)
     {
        List<String> result = new ArrayList<String>();
  
        File[] files = directory.listFiles(new FilenameFilter()
        {
           @Override public boolean accept(File dir, String name)
           {
              return name.toUpperCase().endsWith("STR.P3");
           }
        });
  
        if (files != null)
        {
           for (File file : files)
           {
              String fileName = file.getName();
              String prefix = fileName.substring(0, fileName.length() - 6);
              result.add(prefix);
           }
        }
  
        Collections.sort(result);
  
        return result;
     }
docs: Retrieve a list of the available P3 project names from a directory.
  
  @param directory directory containing P3 files
  @return list of project names