Changeset 2064


Ignore:
Timestamp:
01/10/07 13:56:37 (13 years ago)
Author:
melissa
Message:

Copied server sanity logic from loci.visbio.ome.OMEManager.getProperServer.

File:
1 edited

Legend:

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

    r2055 r2064  
    218218 
    219219    // do sanity check on server name 
    220     if (!server.startsWith("http")) server = "http://" + server; 
    221     if (!server.endsWith("shoola")) server += "/shoola"; 
     220    if (server.startsWith("http:")) { 
     221      server = server.substring(5); 
     222    } 
     223    while (server.startsWith("/")) server = server.substring(1); 
     224    int slash = server.indexOf("/"); 
     225    if (slash >= 0) server = server.substring(0, slash); 
     226    int colon = server.indexOf(":"); 
     227    if (colon >= 0) server = server.substring(0, colon); 
     228 
     229    server = "http://" + server + "/shoola/"; 
    222230 
    223231    Criteria c = new Criteria(); 
Note: See TracChangeset for help on using the changeset viewer.