From d9dfc3301901cc72a6566e6409284b63f57d9ff3 Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Tue, 8 Mar 2022 16:57:37 -0500 Subject: [PATCH 1/8] poi sec update Conflicts: pom.xml --- pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7663bb3e6e6..32a671c0040 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ 5.2.4 1.20.1 0.8.7 + 5.2.1 org.apache.tika - tika-parsers - 1.27 + tika-core + ${tika.version} + + + org.apache.tika + tika-parsers-standard-package + ${tika.version} diff --git a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SetCurationStatusCommand.java b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SetCurationStatusCommand.java index 4a7b8ee1d34..c3a62a35bb3 100644 --- a/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SetCurationStatusCommand.java +++ b/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SetCurationStatusCommand.java @@ -29,7 +29,6 @@ import org.apache.solr.client.solrj.SolrServerException; -import com.beust.jcommander.Strings; import com.google.api.LabelDescriptor; @RequiredPermissions(Permission.PublishDataset) From 2a1247f8191149866ce5e2b7f0f48980c555536d Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Tue, 8 Mar 2022 18:41:44 -0500 Subject: [PATCH 6/8] fix tika IOUtils imports --- .../harvard/iq/dataverse/dataaccess/StoredOriginalFile.java | 3 ++- .../java/edu/harvard/iq/dataverse/search/IndexServiceBean.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/dataaccess/StoredOriginalFile.java b/src/main/java/edu/harvard/iq/dataverse/dataaccess/StoredOriginalFile.java index 587cf847faf..068f11ccf85 100644 --- a/src/main/java/edu/harvard/iq/dataverse/dataaccess/StoredOriginalFile.java +++ b/src/main/java/edu/harvard/iq/dataverse/dataaccess/StoredOriginalFile.java @@ -27,7 +27,8 @@ import java.nio.channels.ReadableByteChannel; import java.util.logging.Logger; -import org.apache.tika.io.IOUtils; +import org.apache.commons.io.IOUtils; + /** * * @author Leonid Andreev diff --git a/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java index e4844156271..7da401b5ce2 100644 --- a/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/search/IndexServiceBean.java @@ -67,6 +67,8 @@ import javax.json.JsonObject; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; + +import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; @@ -80,7 +82,6 @@ import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.params.CursorMarkParams; import org.apache.tika.parser.AutoDetectParser; -import org.apache.tika.io.IOUtils; import org.apache.tika.metadata.Metadata; import org.apache.tika.parser.ParseContext; import org.apache.tika.sax.BodyContentHandler; From 6a1333dbdd07d30bc6833b1bedee7c0faad4434e Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Tue, 8 Mar 2022 22:35:08 -0500 Subject: [PATCH 7/8] replace another Strings.join --- .../java/edu/harvard/iq/dataverse/api/Datasets.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java b/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java index e21396dd487..8c67aecc242 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java @@ -1,6 +1,7 @@ package edu.harvard.iq.dataverse.api; import edu.harvard.iq.dataverse.*; +import edu.harvard.iq.dataverse.DatasetLock.Reason; import edu.harvard.iq.dataverse.actionlogging.ActionLogRecord; import edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean; import edu.harvard.iq.dataverse.authorization.DataverseRole; @@ -146,9 +147,6 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.FormDataParam; import com.amazonaws.services.s3.model.PartETag; -import com.beust.jcommander.Strings; - -import java.util.Map.Entry; @Path("datasets") public class Datasets extends AbstractApiBean { @@ -2691,9 +2689,12 @@ public Response listLocks(@QueryParam("type") String lockType, @QueryParam("user try { lockTypeValue = DatasetLock.Reason.valueOf(lockType); } catch (IllegalArgumentException iax) { - String validValues = Strings.join(",", DatasetLock.Reason.values()); + StringJoiner reasonJoiner = new StringJoiner(", "); + for (Reason r: Reason.values()) { + reasonJoiner.add(r.name()); + }; String errorMessage = "Invalid lock type value: " + lockType + - "; valid lock types: " + validValues; + "; valid lock types: " + reasonJoiner.toString(); return error(Response.Status.BAD_REQUEST, errorMessage); } } From dd968ef2efdb9b4aedd399a902b3018eb5426de7 Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Tue, 8 Mar 2022 22:40:58 -0500 Subject: [PATCH 8/8] adjust richtextstring reading --- .../ingest/tabulardata/impl/plugins/xlsx/XLSXFileReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/xlsx/XLSXFileReader.java b/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/xlsx/XLSXFileReader.java index 4727c847b75..ea3f3868f24 100644 --- a/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/xlsx/XLSXFileReader.java +++ b/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/xlsx/XLSXFileReader.java @@ -410,7 +410,7 @@ public void endElement(String uri, String localName, String name) // Do it now, as characters() may be called more than once if (nextIsString) { int idx = Integer.parseInt(cellContents); - cellContents = new XSSFRichTextString(sst.getEntryAt(idx)).toString(); + cellContents = sst.getItemAt(idx).getString(); nextIsString = false; }