194 } |
194 } |
195 platformPath = platformFile.getPath(); |
195 platformPath = platformFile.getPath(); |
196 } |
196 } |
197 |
197 |
198 if (configDir != null) { |
198 if (configDir != null) { |
199 File configBase = new File(configDir); |
199 String configDirPath = null; |
|
200 String sqlPrefix = "sql:/"; |
|
201 if (!configDir.startsWith(sqlPrefix)) { |
|
202 configDirPath = configDir; |
|
203 } else { |
|
204 StringBuilder configDirPathSB = new StringBuilder(configDir); |
|
205 configDirPath = configDirPathSB.substring(sqlPrefix.length()); |
|
206 } |
|
207 File configBase = new File(configDirPath); |
200 if (configBase.isDirectory() == false ) { |
208 if (configBase.isDirectory() == false ) { |
201 throw new IOException("configDir must be a directory: " + configDir); |
209 throw new IOException("configDir must be a directory: " + configDirPath); |
202 } |
210 } |
203 File secmodFile = new File(configBase, "secmod.db"); |
211 if (!configDir.startsWith(sqlPrefix)) { |
204 if (secmodFile.isFile() == false) { |
212 File secmodFile = new File(configBase, "secmod.db"); |
205 throw new FileNotFoundException(secmodFile.getPath()); |
213 if (secmodFile.isFile() == false) { |
|
214 throw new FileNotFoundException(secmodFile.getPath()); |
|
215 } |
206 } |
216 } |
207 } |
217 } |
208 |
218 |
209 if (DEBUG) System.out.println("lib: " + platformPath); |
219 if (DEBUG) System.out.println("lib: " + platformPath); |
210 nssHandle = nssLoadLibrary(platformPath); |
220 nssHandle = nssLoadLibrary(platformPath); |