diff --git a/build.gradle b/build.gradle index 8cce2cce..fe4bc18d 100644 --- a/build.gradle +++ b/build.gradle @@ -28,19 +28,6 @@ subprojects { testCompile 'org.testng:testng:6.8.21' } - sourceSets { - main { - resources { - srcDir 'src/main/java' - } - } - test { - resources { - srcDir 'src/test/java' - } - } - } - test { useTestNG() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 75b8c7c8..55ce3b55 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon Nov 26 15:12:55 EST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip diff --git a/zulia-client/build.gradle.kts b/zulia-client/build.gradle.kts deleted file mode 100644 index 964a7556..00000000 --- a/zulia-client/build.gradle.kts +++ /dev/null @@ -1,8 +0,0 @@ -apply(from = "../maven.gradle") - -description = "Zulia Client" - -dependencies { - compile(project(":zulia-common")) -} - diff --git a/zulia-client/src/main/java/io/zulia/client/ZuliaRESTClient.java b/zulia-client/src/main/java/io/zulia/client/ZuliaRESTClient.java index 5550bc44..fca3755d 100644 --- a/zulia-client/src/main/java/io/zulia/client/ZuliaRESTClient.java +++ b/zulia-client/src/main/java/io/zulia/client/ZuliaRESTClient.java @@ -3,6 +3,7 @@ import io.zulia.ZuliaConstants; import io.zulia.util.HttpHelper; import io.zulia.util.StreamHelper; +import org.bson.Document; import java.io.File; import java.io.FileInputStream; @@ -12,9 +13,7 @@ import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; -import java.util.ArrayList; import java.util.HashMap; -import java.util.Map; public class ZuliaRESTClient { private String server; @@ -64,7 +63,7 @@ public void storeAssociated(String uniqueId, String indexName, String fileName, storeAssociated(uniqueId, indexName, fileName, null, source); } - public void storeAssociated(String uniqueId, String indexName, String fileName, Map meta, InputStream source) throws IOException { + public void storeAssociated(String uniqueId, String indexName, String fileName, Document metadata, InputStream source) throws IOException { HttpURLConnection conn = null; OutputStream destination = null; try { @@ -73,13 +72,8 @@ public void storeAssociated(String uniqueId, String indexName, String fileName, parameters.put(ZuliaConstants.ID, uniqueId); parameters.put(ZuliaConstants.FILE_NAME, fileName); parameters.put(ZuliaConstants.INDEX, indexName); - if (meta != null) { - ArrayList list = new ArrayList<>(); - parameters.put(ZuliaConstants.META_JSON, list); - for (String key : meta.keySet()) { - String value = meta.get(key); - list.add(key + ":" + value); - } + if (metadata != null) { + parameters.put(ZuliaConstants.META_JSON, metadata.toJson()); } String url = HttpHelper.createRequestUrl(server, restPort, ZuliaConstants.ASSOCIATED_DOCUMENTS_URL, parameters); diff --git a/zulia-client/src/main/java/io/zulia/client/command/StoreLargeAssociated.java b/zulia-client/src/main/java/io/zulia/client/command/StoreLargeAssociated.java index 4e3ac0c8..33e1e38c 100644 --- a/zulia-client/src/main/java/io/zulia/client/command/StoreLargeAssociated.java +++ b/zulia-client/src/main/java/io/zulia/client/command/StoreLargeAssociated.java @@ -4,11 +4,11 @@ import io.zulia.client.command.base.RESTCommand; import io.zulia.client.command.base.ShardRoutableCommand; import io.zulia.client.result.StoreLargeAssociatedResult; +import org.bson.Document; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; -import java.util.Map; public class StoreLargeAssociated extends RESTCommand implements ShardRoutableCommand { @@ -17,7 +17,7 @@ public class StoreLargeAssociated extends RESTCommand meta; + private Document meta; public StoreLargeAssociated(String uniqueId, String indexName, String fileName, File fileToStore) { this.uniqueId = uniqueId; @@ -33,11 +33,11 @@ public StoreLargeAssociated(String uniqueId, String indexName, String fileName, this.source = source; } - public Map getMeta() { + public Document getMeta() { return meta; } - public StoreLargeAssociated setMeta(Map meta) { + public StoreLargeAssociated setMeta(Document meta) { this.meta = meta; return this; } diff --git a/zulia-server/src/main/java/io/zulia/server/analysis/filter/BritishUSFilter.java b/zulia-server/src/main/java/io/zulia/server/analysis/filter/BritishUSFilter.java index 04036eee..e39dadf1 100644 --- a/zulia-server/src/main/java/io/zulia/server/analysis/filter/BritishUSFilter.java +++ b/zulia-server/src/main/java/io/zulia/server/analysis/filter/BritishUSFilter.java @@ -25,7 +25,7 @@ private static CharArrayMap initializeDictHash() { CharArrayMap charMap = new CharArrayMap<>(2000, false); try { - URL url = Resources.getResource(BritishUSFilter.class, "british.txt"); + URL url = BritishUSFilter.class.getResource("/british.txt"); String text = Resources.toString(url, Charsets.UTF8_CHARSET); String[] lines = text.split("\n"); for (String line : lines) { diff --git a/zulia-server/src/main/java/io/zulia/server/analysis/filter/british.txt b/zulia-server/src/main/resources/british.txt similarity index 100% rename from zulia-server/src/main/java/io/zulia/server/analysis/filter/british.txt rename to zulia-server/src/main/resources/british.txt