Changeset 2739


Ignore:
Timestamp:
05/03/07 15:19:53 (13 years ago)
Author:
melissa
Message:

Don't throw an exception if there is no companion file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/MetamorphReader.java

    r2737 r2739  
    288288    } 
    289289 
    290     RandomAccessStream ndStream =  
    291       new RandomAccessStream(ndfile.getAbsolutePath()); 
    292     String line = ndStream.readLine().trim(); 
    293  
    294     while (!line.equals("\"EndFile\"")) { 
    295       String key = line.substring(1, line.indexOf(",") - 1).trim(); 
    296       String value = line.substring(line.indexOf(",") + 1).trim(); 
     290    if (ndfile.exists()) { 
     291      RandomAccessStream ndStream =  
     292        new RandomAccessStream(ndfile.getAbsolutePath()); 
     293      String line = ndStream.readLine().trim(); 
     294 
     295      while (!line.equals("\"EndFile\"")) { 
     296        String key = line.substring(1, line.indexOf(",") - 1).trim(); 
     297        String value = line.substring(line.indexOf(",") + 1).trim(); 
    297298      
    298       addMeta(key, value); 
    299        
    300       line = ndStream.readLine().trim();  
    301     } 
    302  
     299        addMeta(key, value); 
     300        line = ndStream.readLine().trim();  
     301      } 
     302    } 
    303303  } 
    304304 
Note: See TracChangeset for help on using the changeset viewer.