|
16 | 16 | * specific language governing permissions and limitations |
17 | 17 | * under the License. |
18 | 18 | */ |
19 | | - |
20 | 19 | package org.apache.jackrabbit.oak.plugins.index.importer; |
21 | 20 |
|
22 | 21 | import java.io.File; |
23 | 22 | import java.io.IOException; |
24 | 23 | import java.io.PrintWriter; |
25 | 24 | import java.io.StringWriter; |
26 | | -import java.nio.charset.StandardCharsets; |
| 25 | +import java.nio.file.Files; |
| 26 | +import java.nio.file.Path; |
27 | 27 | import java.text.MessageFormat; |
28 | 28 | import java.util.Properties; |
29 | 29 | import java.util.Set; |
30 | 30 |
|
31 | | -import org.apache.jackrabbit.guava.common.io.Files; |
32 | 31 | import org.apache.felix.inventory.Format; |
33 | 32 | import org.apache.jackrabbit.oak.api.CommitFailedException; |
34 | 33 | import org.apache.jackrabbit.oak.api.Type; |
@@ -314,7 +313,7 @@ public void importIndex_newIndex() throws Exception{ |
314 | 313 | info.save(); |
315 | 314 |
|
316 | 315 | //Create index definitions json |
317 | | - Files.write(json, new File(indexFolder, INDEX_DEFINITIONS_JSON), StandardCharsets.UTF_8); |
| 316 | + Files.writeString(indexFolder.toPath().resolve(INDEX_DEFINITIONS_JSON), json); |
318 | 317 |
|
319 | 318 | createIndexFolder(indexFolder, "/oak:index/fooIndex"); |
320 | 319 |
|
@@ -554,11 +553,11 @@ private void createIndexFolder(File indexFolder, String indexPath) throws IOExce |
554 | 553 | private void dumpIndexDefinitions(String... indexPaths) throws IOException { |
555 | 554 | IndexDefinitionPrinter printer = new IndexDefinitionPrinter(store, () -> asList(indexPaths)); |
556 | 555 | printer.setFilter("{\"properties\":[\"*\", \"-:childOrder\"],\"nodes\":[\"*\", \"-:index-definition\"]}"); |
557 | | - File file = new File(temporaryFolder.getRoot(), INDEX_DEFINITIONS_JSON); |
| 556 | + Path file = temporaryFolder.getRoot().toPath().resolve(INDEX_DEFINITIONS_JSON); |
558 | 557 | StringWriter sw = new StringWriter(); |
559 | 558 | PrintWriter pw = new PrintWriter(sw); |
560 | 559 | printer.print(pw, Format.JSON, false); |
561 | | - Files.write(sw.toString(), file, StandardCharsets.UTF_8); |
| 560 | + Files.writeString(file, sw.toString()); |
562 | 561 | } |
563 | 562 |
|
564 | 563 | private String importDataIncrementalUpdateBeforeSetupMethod() throws IOException, CommitFailedException { |
|
0 commit comments