any23-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ans...@apache.org
Subject [3/6] any23 git commit: Detection MIME based on the file URI rather than on the base namespace.
Date Thu, 13 Jul 2017 05:51:23 GMT
Detection MIME based on the file URI rather than on the base namespace.

- file path add to meta
- add documentation to unit test

Signed-off-by: Jacek Grzebyta <grzebyta.dev@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/any23/repo
Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/0b82fdc2
Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/0b82fdc2
Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/0b82fdc2

Branch: refs/heads/master
Commit: 0b82fdc205512acfd2a04d04ec547b6e36581e3b
Parents: c4c75a0
Author: Jacek Grzebyta <grzebyta.dev@gmail.com>
Authored: Wed Jul 12 17:06:50 2017 +0100
Committer: Jacek Grzebyta <grzebyta.dev@gmail.com>
Committed: Wed Jul 12 17:33:35 2017 +0100

----------------------------------------------------------------------
 cli/src/test/java/org/apache/any23/cli/YAMLRoverTest.java       | 5 ++++-
 .../org/apache/any23/extractor/SingleDocumentExtraction.java    | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/any23/blob/0b82fdc2/cli/src/test/java/org/apache/any23/cli/YAMLRoverTest.java
----------------------------------------------------------------------
diff --git a/cli/src/test/java/org/apache/any23/cli/YAMLRoverTest.java b/cli/src/test/java/org/apache/any23/cli/YAMLRoverTest.java
index 17e8916..4600452 100644
--- a/cli/src/test/java/org/apache/any23/cli/YAMLRoverTest.java
+++ b/cli/src/test/java/org/apache/any23/cli/YAMLRoverTest.java
@@ -62,7 +62,10 @@ public class YAMLRoverTest extends ToolTestBase {
     }
 
     /**
-     *
+     * Asserts if file contains wanted string.
+     * 
+     * If logging level is <tt>trace</tt> than additionally displays file content.
+     * 
      * @param f
      * @param s Expected string in the file
      * @return

http://git-wip-us.apache.org/repos/asf/any23/blob/0b82fdc2/core/src/main/java/org/apache/any23/extractor/SingleDocumentExtraction.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/any23/extractor/SingleDocumentExtraction.java b/core/src/main/java/org/apache/any23/extractor/SingleDocumentExtraction.java
index d88edf7..3498108 100644
--- a/core/src/main/java/org/apache/any23/extractor/SingleDocumentExtraction.java
+++ b/core/src/main/java/org/apache/any23/extractor/SingleDocumentExtraction.java
@@ -422,8 +422,9 @@ public class SingleDocumentExtraction {
             return;
         }
         ensureHasLocalCopy();
+        // detect MIME based on the real file IRI rather than based on given base namespace
         detectedMIMEType = detector.guessMIMEType(
-                java.net.URI.create(documentIRI.stringValue()).getPath(),
+                java.net.URI.create(in.getDocumentIRI()).getPath(),
                 localDocumentSource.openInputStream(),
                 MIMEType.parse(localDocumentSource.getContentType())
         );


Mime
View raw message