Changeset 2317


Ignore:
Timestamp:
02/22/07 16:25:32 (13 years ago)
Author:
curtis
Message:

Add logic in testRead to output used files as part of core metadata.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatReader.java

    r2292 r2317  
    790790    System.out.println(); 
    791791    System.out.println("Reading core metadata"); 
    792     System.out.println((stitch ? "File pattern = " + id : 
    793       "Filename = " + reader.getCurrentFile())); 
     792    System.out.println(stitch ? 
     793      "File pattern = " + id : "Filename = " + reader.getCurrentFile()); 
    794794    if (map != null) System.out.println("Mapped filename = " + map); 
     795    String[] used = reader.getUsedFiles(id); 
     796    boolean usedValid = used != null && used.length > 0; 
     797    if (usedValid) { 
     798      for (int u=0; u<used.length; u++) { 
     799        if (used[u] == null) { 
     800          usedValid = false; 
     801          break; 
     802        } 
     803      } 
     804    } 
     805    if (!usedValid) { 
     806      System.out.println( 
     807        "************ Warning: invalid used files list ************"); 
     808    } 
     809    if (used == null) { 
     810      System.out.println("Used files = null"); 
     811    } 
     812    else if (used.length == 0) { 
     813      System.out.println("Used files = []"); 
     814    } 
     815    else if (used.length > 1) { 
     816      System.out.println("Used files:"); 
     817      for (int u=0; u<used.length; u++) System.out.println("\t" + used[u]); 
     818    } 
     819    else if (!id.equals(used[0])) { 
     820      System.out.println("Used files = [" + used[0] + "]"); 
     821    } 
    795822    int seriesCount = reader.getSeriesCount(id); 
    796823    System.out.println("Series count = " + seriesCount); 
Note: See TracChangeset for help on using the changeset viewer.