Source:
private MongoSchemaStore createSchemaStore(String schemaStoreURI) { if (schemaStoreURI.startsWith("file:")) { try { if (MongoUtil.isZipFile(schemaStoreURI)) return new MongoSchemaZipFileStore(schemaStoreURI); return new MongoSchemaFileStore(schemaStoreURI); } catch (URISyntaxException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } } else if (schemaStoreURI.startsWith("mongodb:")) { try { return new MongoSchemaDBStore(schemaStoreURI); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create mongodb-based schema store with URI \"" + schemaStoreURI + "\"", e); } } else if (schemaStoreURI.startsWith(MongoSchemaFileStore.PRE_FIX_HTTP)) { try { File downloadFile = downloadFile(dataStoreDB.getName(), new URL(schemaStoreURI), httpClient); if (MongoUtil.isZipFile(downloadFile)) return new MongoSchemaZipFileStore(downloadFile.toURI()); else return new MongoSchemaFileStore(downloadFile.getParentFile().toURI()); } catch (Exception e) { LOGGER.log( Level.SEVERE, "Unable to create mongodb-based schema store with URL \"" + schemaStoreURI + "\"", e); } } else { try { return new MongoSchemaFileStore("file:" + schemaStoreURI); } catch (URISyntaxException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } } LOGGER.log(Level.SEVERE, "Unsupported URI \"{0}\" for schema store", schemaStoreURI); return null; }

Target:
private synchronized MongoSchemaStore createSchemaStore(String schemaStoreURI) { if (schemaStoreURI.startsWith("file:")) { try { return new MongoSchemaFileStore(schemaStoreURI); } catch (URISyntaxException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } } else if (schemaStoreURI.startsWith("mongodb:")) { try { return new MongoSchemaDBStore(schemaStoreURI); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create mongodb-based schema store with URI \"" + schemaStoreURI + "\"", e); } } else if (schemaStoreURI.startsWith(MongoSchemaFileStore.PRE_FIX_HTTP)) { try { File downloadedFile = MongoUtil.downloadSchemaFile( dataStoreDB.getName(), new URL(schemaStoreURI), httpClient, SchemaStoreDirectoryProvider.getHighestPriority()); if (MongoUtil.isZipFile(downloadedFile)) { File extractedFileLocation = MongoUtil.extractZipFile( downloadedFile.getParentFile(), downloadedFile); LOGGER.log( Level.INFO, "Found Schema Files at " + extractedFileLocation.toString() + "after extracting "); return new MongoSchemaFileStore(extractedFileLocation.toURI()); } else return new MongoSchemaFileStore(downloadedFile.getParentFile().toURI()); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } } else { try { return new MongoSchemaFileStore("file:" + schemaStoreURI); } catch (URISyntaxException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } catch (IOException e) { LOGGER.log( Level.SEVERE, "Unable to create file-based schema store with URI \"" + schemaStoreURI + "\"", e); } } LOGGER.log(Level.SEVERE, "Unsupported URI \"{0}\" for schema store", schemaStoreURI); return null; }