Changeset 2140 for trunk/java-client/org/nzdl/gsdl/SimpleClient.java
- Timestamp:
- 2001-03-09T11:30:02+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/org/nzdl/gsdl/SimpleClient.java
r2135 r2140 106 106 int verbosity = 2; 107 107 108 String[] urlsCompiledIn =109 {110 "http://nikau.cs.waikato.ac.nz/~say1/gsdl/cgi-bin/getior",111 "http://www.nzdl.org/cgi-bin/getior"112 };113 114 108 /** 115 109 * Basic no-args constructor. Not recommended for normal use, … … 117 111 */ 118 112 protected SimpleClient() { 119 init(null); 113 nzdl = NzdlIORs.findIOR(null, URLFromCommandLine, 114 IORFileName, IORFromCommandLine); 115 if (nzdl == null) 116 throw new Error("URK! unable to find an IOR..."); 120 117 } 121 118 … … 126 123 SimpleClient(String [] args) { 127 124 parseArgs(args); 128 init(args); 129 } 130 131 /** 132 * 133 */ 134 protected void init(String [] args) { 135 136 // read our prevously seed IORs ... 137 String IOR = null; 138 139 // try a URL from the command line 140 if (URLFromCommandLine != null) { 141 IOR = NzdlIORs.getIORfromURL(URLFromCommandLine); 142 attemptToInitialise(args, null, IOR); 143 } 144 145 // try an IOR from the command line 146 if (IORFromCommandLine != null && nzdl == null) { 147 IOR = NzdlIORs. registerIOR(IORFromCommandLine); 148 attemptToInitialise(args, null, IOR); 149 } 150 151 // try an IOR from a file (the filename may have been 152 // given from teh commandline 153 if (nzdl == null) { 154 IOR = NzdlIORs.getIORfromFile(IORFileName); 155 attemptToInitialise(args, null, IOR); 156 } 157 158 // try the compiled-in URLs 159 if (nzdl == null) { 160 for (int i=0;( i<urlsCompiledIn.length && nzdl == null );i++) { 161 IOR = NzdlIORs.getIORfromURL(urlsCompiledIn[i]); 162 attemptToInitialise(args, null,IOR); 163 } 164 } 165 166 // the knownIORs is the last resort 167 if (nzdl == null) { 168 IOR = NzdlIORs.getFirstValid(); 169 attemptToInitialise(args, null, IOR); 170 } 171 } 125 nzdl = NzdlIORs.findIOR(args, URLFromCommandLine, 126 IORFileName, IORFromCommandLine); 127 if (nzdl == null) 128 throw new Error("URK! unable to find an IOR..."); 129 } 130 172 131 173 132 private boolean attemptToInitialise(String [] _args,
Note:
See TracChangeset
for help on using the changeset viewer.