<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sdnr-wt-data-provider-setup</artifactId>
<version>${project.version}</version>
<goal>exec</goal>
</goals>
<configuration>
- <executable>java</executable>
+ <executable>java</executable>
<arguments>
<argument>-jar</argument>
- <argument>${basedir}/../../data-provider/setup/target/sdnr-dmt.jar</argument>
+ <argument>${basedir}/../setup/target/sdnr-dmt.jar</argument>
<argument>-c</argument>
<argument>pluginfile</argument>
<argument>-of</argument>
* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
* All rights reserved.
* ================================================================================
+ * Update Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
import java.io.File;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
"{\"type\":\"custom\",\"tokenizer\":\"whitespace\"}}}}";
public static void create(Release release, String filename) throws IOException {
-
+
ReleaseInformation ri = ReleaseInformation.getInstance(release);
Set<ComponentName> comps=ri.getComponents();
- List<String> lines = new ArrayList<String>();
+ List<String> lines = new ArrayList<>();
for(ComponentName c:comps) {
lines.add(String.format("PUT:%s/:{"+settings+","+mappings+"}",ri.getIndex(c),shards,replicas,ri.getDatabaseMapping(c)));
lines.add(String.format("PUT:%s/_alias/%s/:{}", ri.getIndex(c),ri.getAlias(c)));
}
- Files.write(new File(filename).toPath(),lines,StandardCharsets.UTF_8);
-
+
+ File filePath = new File(filename);
+ if (filePath.getParentFile() != null && !filePath.getParentFile().exists()){
+ //Crate Directory if missing
+ filePath.getParentFile().mkdirs();
+ }
+ Files.write(filePath.toPath(), lines);
}
}