Changeset 298
- Timestamp:
- 02/05/10 22:24:19 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/corelib/src/org/bridgedb/webservice/bridgerest/BridgeRest.java
r288 r298 55 55 /** {@inheritDoc} */ 56 56 public IDMapper connect(String location) throws IDMapperException { 57 return new BridgeRest(location); 57 // replace all spaces by "%20" to access organisms such as "Arabidopsis theliana" 58 return new BridgeRest(location.replaceAll(" ", "%20")); 58 59 } 59 60 } … … 143 144 throws IDMapperException 144 145 { 145 return loadDataSources("sourceDataSources"); 146 if (supportedSrcDataSources==null) { 147 supportedSrcDataSources = loadDataSources("sourceDataSources"); 148 } 149 return supportedSrcDataSources; 146 150 } 147 151 … … 150 154 throws IDMapperException 151 155 { 152 return loadDataSources("targetDataSources"); 156 if (supportedTgtDataSources==null) { 157 supportedTgtDataSources = loadDataSources("targetDataSources"); 158 } 159 return supportedTgtDataSources; 153 160 } 154 161 … … 180 187 181 188 private final IDMapperCapabilities capabilities; 189 190 private Set<DataSource> supportedSrcDataSources = null; 191 private Set<DataSource> supportedTgtDataSources = null; 192 private Set<String> attributeSet = null; 182 193 183 194 /** … … 446 457 /** {@inheritDoc} */ 447 458 public Set<String> getAttributeSet() throws IDMapperException { 448 try { 449 Set<String> results = new HashSet<String>(); 450 451 BufferedReader in = new UrlBuilder ("attributeSet") 452 .openReader(); 453 String line; 454 while ((line = in.readLine()) != null) { 455 results.add(line); 456 } 457 in.close(); 458 return results; 459 } catch (IOException ex) { 460 throw new IDMapperException (ex); 461 } 459 if (attributeSet==null) { 460 try { 461 Set<String> results = new HashSet<String>(); 462 463 BufferedReader in = new UrlBuilder ("attributeSet") 464 .openReader(); 465 String line; 466 while ((line = in.readLine()) != null) { 467 results.add(line); 468 } 469 in.close(); 470 attributeSet = results; 471 } catch (IOException ex) { 472 throw new IDMapperException (ex); 473 } 474 } 475 476 return attributeSet; 462 477 } 463 478
