Changeset 5635


Ignore:
Timestamp:
10/27/09 11:38:59 (10 years ago)
Author:
melissa
Message:

Ensure that all .res files are picked up if a .mea file is selected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/FlexReader.java

    r5625 r5635  
    303303      } 
    304304    } 
     305    else { 
     306      String[] files = findFiles(file, new String[] {RES_SUFFIX}); 
     307      if (files != null) { 
     308        for (String f : files) { 
     309          measurementFiles.add(f); 
     310        } 
     311      } 
     312    } 
    305313 
    306314    MetadataStore store = 
     
    668676   */ 
    669677  private String[] findFiles(Location baseFile) throws IOException { 
     678    String[] suffixes = new String[0]; 
     679    if (checkSuffix(baseFile.getName(), FLEX_SUFFIX)) { 
     680      suffixes = new String[] {MEA_SUFFIX, RES_SUFFIX}; 
     681      debug("Looking for files with the suffix '" + MEA_SUFFIX + "' or '" + 
     682        RES_SUFFIX + "'."); 
     683    } 
     684    else if (checkSuffix(baseFile.getName(), MEA_SUFFIX)) { 
     685      suffixes = new String[] {FLEX_SUFFIX, RES_SUFFIX}; 
     686      debug("Looking for files with the suffix '" + FLEX_SUFFIX + "' or '" + 
     687        RES_SUFFIX + "'."); 
     688    } 
     689 
     690    return findFiles(baseFile, suffixes); 
     691  } 
     692 
     693  private String[] findFiles(Location baseFile, String[] suffixes) 
     694    throws IOException 
     695  { 
    670696    // we're assuming that the directory structure looks something like this: 
    671697    // 
     
    689715 
    690716    Vector<String> fileList = new Vector<String>(); 
    691  
    692     String[] suffixes = new String[0]; 
    693     if (checkSuffix(baseFile.getName(), FLEX_SUFFIX)) { 
    694       suffixes = new String[] {MEA_SUFFIX, RES_SUFFIX}; 
    695       debug("Looking for files with the suffix '" + MEA_SUFFIX + "' or '" + 
    696         RES_SUFFIX + "'."); 
    697     } 
    698     else if (checkSuffix(baseFile.getName(), MEA_SUFFIX)) { 
    699       suffixes = new String[] {FLEX_SUFFIX, RES_SUFFIX}; 
    700       debug("Looking for files with the suffix '" + FLEX_SUFFIX + "' or '" + 
    701         RES_SUFFIX + "'."); 
    702     } 
    703717 
    704718    Location plateDir = baseFile.getParentFile(); 
Note: See TracChangeset for help on using the changeset viewer.