You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2018/04/19 14:54:31 UTC

[tika] branch branch_1x updated (a39b325 -> c68994f)

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a change to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git.


    from a39b325  [maven-release-plugin] prepare for next development iteration
     new bb7adac  TIKA-2634 upgrade Jackson to 2.9.5
     new a8b41d3  TIKA-2634 upgrade Jackson to 2.9.5
     new 85b2504  Merge remote-tracking branch 'origin/branch_1x' into branch_1x
     new c68994f  fix broken build on *nix caused by recent fixes; improve documentation; ensure trailing slash behavior on all OS

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.txt                                        |  4 ++-
 tika-nlp/pom.xml                                   | 13 +++++++-
 tika-parent/pom.xml                                |  1 +
 tika-parsers/pom.xml                               | 23 +++++++++++++-
 .../apache/tika/parser/ocr/TesseractOCRConfig.java | 36 +++++++++++++++-------
 .../apache/tika/parser/ocr/TesseractOCRParser.java |  8 +++--
 .../tika/parser/ocr/TesseractOCRConfigTest.java    | 28 ++++++++++++++++-
 tika-translate/pom.xml                             | 25 ++++++++++++++-
 8 files changed, 119 insertions(+), 19 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
tallison@apache.org.

[tika] 02/04: TIKA-2634 upgrade Jackson to 2.9.5

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit a8b41d30e2d2065f53f6c0707980586d64f246f2
Author: tballison <ta...@mitre.org>
AuthorDate: Thu Apr 19 09:33:29 2018 -0400

    TIKA-2634 upgrade Jackson to 2.9.5
---
 CHANGES.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index dcf00da..f260e17 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
-Release 1.18 - 4/10/2018
+Release 1.18 - ???
+
+   * Upgrade Jackson to 2.9.5 (TIKA-2634).
 
    * Add support for brotli (TIKA-2621).
 

-- 
To stop receiving notification emails like this one, please contact
tallison@apache.org.

[tika] 04/04: fix broken build on *nix caused by recent fixes; improve documentation; ensure trailing slash behavior on all OS

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit c68994fecc3c2b10e433c1a1306c794f52e99def
Author: tballison <ta...@mitre.org>
AuthorDate: Thu Apr 19 10:53:39 2018 -0400

    fix broken build on *nix caused by recent fixes; improve documentation; ensure trailing slash behavior on all OS
---
 .../apache/tika/parser/ocr/TesseractOCRConfig.java | 36 +++++++++++++++-------
 .../apache/tika/parser/ocr/TesseractOCRParser.java |  8 +++--
 .../tika/parser/ocr/TesseractOCRConfigTest.java    | 28 ++++++++++++++++-
 3 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRConfig.java b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRConfig.java
index ba00c20..c6ff21c 100644
--- a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRConfig.java
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRConfig.java
@@ -18,6 +18,7 @@ package org.apache.tika.parser.ocr;
 
 import org.apache.commons.io.FilenameUtils;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
@@ -85,7 +86,7 @@ public class TesseractOCRConfig implements Serializable {
     private int enableImageProcessing = 0;
 
     // Path to ImageMagick program, if not on system path.
-    private String ImageMagickPath = "";
+    private String imageMagickPath = "";
 
     // resolution of processed image (in dpi).
     private int density = 300;
@@ -198,14 +199,19 @@ public class TesseractOCRConfig implements Serializable {
     }
 
     /**
-     * Set the path to the Tesseract executable, needed if it is not on system path.
+     * Set the path to the Tesseract executable's directory, needed if it is not on system path.
      * <p>
      * Note that if you set this value, it is highly recommended that you also
      * set the path to the 'tessdata' folder using {@link #setTessdataPath}.
      * </p>
      */
     public void setTesseractPath(String tesseractPath) {
-        this.tesseractPath = FilenameUtils.normalize(tesseractPath);
+
+        tesseractPath = FilenameUtils.normalize(tesseractPath);
+        if (!tesseractPath.isEmpty() && !tesseractPath.endsWith(File.separator))
+            tesseractPath += File.separator;
+
+        this.tesseractPath = tesseractPath;
     }
 
     /**
@@ -221,7 +227,11 @@ public class TesseractOCRConfig implements Serializable {
      * (such as when Tesseract is built from source), it may be located elsewhere.
      */
     public void setTessdataPath(String tessdataPath) {
-        this.tessdataPath = FilenameUtils.normalize(tessdataPath);
+        tessdataPath = FilenameUtils.normalize(tessdataPath);
+        if (!tessdataPath.isEmpty() && !tessdataPath.endsWith(File.separator))
+            tessdataPath += File.separator;
+
+        this.tessdataPath = tessdataPath;
     }
 
     /**
@@ -515,21 +525,25 @@ public class TesseractOCRConfig implements Serializable {
     }
 
     /**
-     * @return path to ImageMagick file.
-     * @see #setImageMagickPath(String ImageMagickPath)
+     * @return path to ImageMagick executable directory.
+     * @see #setImageMagickPath(String imageMagickPath)
      */
     public String getImageMagickPath() {
 
-        return ImageMagickPath;
+        return imageMagickPath;
     }
 
     /**
-     * Set the path to the ImageMagick executable, needed if it is not on system path.
+     * Set the path to the ImageMagick executable directory, needed if it is not on system path.
      *
-     * @param ImageMagickPath to ImageMagick file.
+     * @param imageMagickPath to ImageMagick executable directory.
      */
-    public void setImageMagickPath(String ImageMagickPath) {
-        this.ImageMagickPath = FilenameUtils.normalize(ImageMagickPath);
+    public void setImageMagickPath(String imageMagickPath) {
+        imageMagickPath = FilenameUtils.normalize(imageMagickPath);
+        if (!imageMagickPath.isEmpty() && !imageMagickPath.endsWith(File.separator))
+            imageMagickPath += File.separator;
+
+        this.imageMagickPath = imageMagickPath;
     }
 
     /**
diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
index 5bd2bad..4d81023 100644
--- a/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java
@@ -152,7 +152,8 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
             TESSERACT_PRESENT.clear();
         }
         //check that the parent directory exists
-        if (! Files.isDirectory(Paths.get(config.getTesseractPath()))) {
+        if (! config.getTesseractPath().isEmpty() &&
+                ! Files.isDirectory(Paths.get(config.getTesseractPath()))) {
             TESSERACT_PRESENT.put(tesseract, false);
             return false;
         }
@@ -178,7 +179,8 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
             IMAGE_MAGICK_PRESENT.clear();
         }
         //check that directory exists
-        if (! Files.isDirectory(Paths.get(config.getImageMagickPath()))) {
+        if (!config.getImageMagickPath().isEmpty() &&
+                ! Files.isDirectory(Paths.get(config.getImageMagickPath()))) {
             IMAGE_MAGICK_PRESENT.put(ImageMagick, false);
             return false;
         }
@@ -378,7 +380,7 @@ public class TesseractOCRParser extends AbstractParser implements Initializable
                 "-density", Integer.toString(config.getDensity()),
                 "-depth ", Integer.toString(config.getDepth()),
                 "-colorspace", config.getColorspace(),
-                " -filter ", config.getFilter(),
+                "-filter", config.getFilter(),
                 "-resize", config.getResize() + "%",
                 "-rotate", angle,
                 scratchFile.getAbsolutePath(),
diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/ocr/TesseractOCRConfigTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/ocr/TesseractOCRConfigTest.java
index 7517f7b..a4bd515 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/ocr/TesseractOCRConfigTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/ocr/TesseractOCRConfigTest.java
@@ -219,7 +219,33 @@ public class TesseractOCRConfigTest extends TikaTest {
         //allow path that doesn't actually exist
         TesseractOCRConfig config = new TesseractOCRConfig();
         config.setTesseractPath("blahdeblahblah");
-        assertEquals("blahdeblahblah", config.getTesseractPath());
+        assertEquals("blahdeblahblah"+File.separator, config.getTesseractPath());
+    }
+
+    @Test
+    public void testTrailingSlashInPathBehavior() {
+
+        TesseractOCRConfig config = new TesseractOCRConfig();
+        config.setTesseractPath("blah");
+        assertEquals("blah"+File.separator, config.getTesseractPath());
+        config.setTesseractPath("blah"+File.separator);
+        assertEquals("blah"+File.separator, config.getTesseractPath());
+        config.setTesseractPath("");
+        assertEquals("", config.getTesseractPath());
+
+        config.setTessdataPath("blahdata");
+        assertEquals("blahdata"+File.separator, config.getTessdataPath());
+        config.setTessdataPath("blahdata"+File.separator);
+        assertEquals("blahdata"+File.separator, config.getTessdataPath());
+        config.setTessdataPath("");
+        assertEquals("", config.getTessdataPath());
+
+        config.setImageMagickPath("imagemagickpath");
+        assertEquals("imagemagickpath"+File.separator, config.getImageMagickPath());
+        config.setImageMagickPath("imagemagickpath"+File.separator);
+        assertEquals("imagemagickpath"+File.separator, config.getImageMagickPath());
+        config.setImageMagickPath("");
+        assertEquals("", config.getImageMagickPath());
     }
 
     @Test(expected=IllegalArgumentException.class)

-- 
To stop receiving notification emails like this one, please contact
tallison@apache.org.

[tika] 03/04: Merge remote-tracking branch 'origin/branch_1x' into branch_1x

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 85b2504bc91462f0dd20ec9362661b5c4384ec11
Merge: a8b41d3 a39b325
Author: tballison <ta...@mitre.org>
AuthorDate: Thu Apr 19 09:35:58 2018 -0400

    Merge remote-tracking branch 'origin/branch_1x' into branch_1x
    
    # Conflicts:
    #	CHANGES.txt

 pom.xml                    | 2 +-
 tika-app/pom.xml           | 2 +-
 tika-batch/pom.xml         | 2 +-
 tika-bundle/pom.xml        | 2 +-
 tika-core/pom.xml          | 2 +-
 tika-dl/pom.xml            | 2 +-
 tika-eval/pom.xml          | 2 +-
 tika-example/pom.xml       | 2 +-
 tika-java7/pom.xml         | 2 +-
 tika-langdetect/pom.xml    | 2 +-
 tika-nlp/pom.xml           | 2 +-
 tika-parent/pom.xml        | 2 +-
 tika-parsers/pom.xml       | 2 +-
 tika-serialization/pom.xml | 2 +-
 tika-server/pom.xml        | 2 +-
 tika-translate/pom.xml     | 2 +-
 tika-xmp/pom.xml           | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)


-- 
To stop receiving notification emails like this one, please contact
tallison@apache.org.

[tika] 01/04: TIKA-2634 upgrade Jackson to 2.9.5

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit bb7adacb2b19e7d5f645ed3d6dbcde4d461f1f44
Author: tballison <ta...@mitre.org>
AuthorDate: Thu Apr 19 09:27:18 2018 -0400

    TIKA-2634 upgrade Jackson to 2.9.5
---
 tika-nlp/pom.xml       | 13 ++++++++++++-
 tika-parent/pom.xml    |  1 +
 tika-parsers/pom.xml   | 23 ++++++++++++++++++++++-
 tika-translate/pom.xml | 25 ++++++++++++++++++++++++-
 4 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/tika-nlp/pom.xml b/tika-nlp/pom.xml
index 7b59e25..414f607 100644
--- a/tika-nlp/pom.xml
+++ b/tika-nlp/pom.xml
@@ -187,7 +187,18 @@
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
-      <version>2.6.5</version>
+      <version>${jackson.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-annotations</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+      <version>${jackson.version}</version>
     </dependency>
     <!-- Test dependencies -->
     <dependency>
diff --git a/tika-parent/pom.xml b/tika-parent/pom.xml
index 894b0d5..7005f3e 100644
--- a/tika-parent/pom.xml
+++ b/tika-parent/pom.xml
@@ -311,6 +311,7 @@
     <gson.version>2.8.1</gson.version>
     <cxf.version>3.0.16</cxf.version>
     <slf4j.version>1.7.24</slf4j.version>
+    <jackson.version>2.9.5</jackson.version>
   </properties>
 
   <build>
diff --git a/tika-parsers/pom.xml b/tika-parsers/pom.xml
index e6c7720..891ba96 100644
--- a/tika-parsers/pom.xml
+++ b/tika-parsers/pom.xml
@@ -683,8 +683,29 @@
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-core</artifactId>
-      <version>2.9.4</version>
+      <version>${jackson.version}</version>
     </dependency>
+    <!-- as of 2.9.5, jackson-databind is pulling in jackson-annotations 2.9.0
+      For now, we need to specify databind here with exclusion statement
+    -->
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+      <version>${jackson.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-annotations</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+      <version>${jackson.version}</version>
+    </dependency>
+
+
     <dependency>
       <groupId>org.apache.pdfbox</groupId>
       <artifactId>jbig2-imageio</artifactId>
diff --git a/tika-translate/pom.xml b/tika-translate/pom.xml
index b8e6919..2bcb505 100644
--- a/tika-translate/pom.xml
+++ b/tika-translate/pom.xml
@@ -66,11 +66,34 @@
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-rt-frontend-jaxrs</artifactId>
       <version>${cxf.version}</version>
+      <exclusions>
+        <!-- exclude because, as of 2.9.5, jaxb-annotations
+        is bringing in 2.9.0 of core's annotations
+        -->
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-annotations</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>com.fasterxml.jackson.jaxrs</groupId>
       <artifactId>jackson-jaxrs-json-provider</artifactId>
-      <version>2.9.4</version>
+      <version>${jackson.version}</version>
+      <exclusions>
+        <!-- exclude because, as of 2.9.5, jaxrs-json-provider
+        is bringing in 2.9.0 of core's annotations
+        -->
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-annotations</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+      <version>${jackson.version}</version>
     </dependency>
 
     <!-- Test dependencies -->

-- 
To stop receiving notification emails like this one, please contact
tallison@apache.org.