|
21 | 21 | import com.uid2.shared.secure.*; |
22 | 22 | import com.uid2.shared.vertx.RequestCapturingHandler; |
23 | 23 | import com.uid2.shared.vertx.VertxUtils; |
24 | | -import io.vertx.config.ConfigRetriever; |
25 | | -import io.vertx.config.ConfigRetrieverOptions; |
26 | | -import io.vertx.config.ConfigStoreOptions; |
27 | 24 | import io.vertx.core.AbstractVerticle; |
28 | 25 | import io.vertx.core.Promise; |
| 26 | +import io.vertx.core.file.FileSystem; |
29 | 27 | import io.vertx.core.http.HttpHeaders; |
30 | 28 | import io.vertx.core.http.HttpMethod; |
31 | 29 | import io.vertx.core.http.HttpServerResponse; |
@@ -207,19 +205,15 @@ private Router createRoutesSetup() { |
207 | 205 | private void handleGetConfig(RoutingContext rc) { |
208 | 206 | String dummyConfigPath = "conf/dummy-config.json"; |
209 | 207 |
|
210 | | - ConfigStoreOptions dummyFileStore = new ConfigStoreOptions() |
211 | | - .setType("file") |
212 | | - .setConfig(new JsonObject().put("path", dummyConfigPath)); |
| 208 | + FileSystem fs = vertx.fileSystem(); |
213 | 209 |
|
214 | | - ConfigRetrieverOptions retrieverOptions = new ConfigRetrieverOptions().addStore(dummyFileStore); |
215 | | - |
216 | | - ConfigRetriever retriever = ConfigRetriever.create(vertx, retrieverOptions); |
217 | | - |
218 | | - retriever.getConfig().onComplete(ar -> { |
| 210 | + fs.readFile(dummyConfigPath, ar -> { |
219 | 211 | if (ar.succeeded()) { |
| 212 | + String fileContent = ar.result().toString(); |
| 213 | + JsonObject configJson = new JsonObject(fileContent); |
220 | 214 | rc.response() |
221 | 215 | .putHeader("content-type", "application/json") |
222 | | - .end(ar.result().encodePrettily()); |
| 216 | + .end(configJson.encodePrettily()); |
223 | 217 | } else { |
224 | 218 | rc.response() |
225 | 219 | .setStatusCode(500) |
|
0 commit comments