Repository: tika Updated Branches: refs/heads/2.x 60d4e3ff2 -> b3bf5141b
TIKA-2008 -- change metadata key to TikaCoreProperties.MODIFIER Project: http://git-wip-us.apache.org/repos/asf/tika/repo Commit: http://git-wip-us.apache.org/repos/asf/tika/commit/b3bf5141 Tree: http://git-wip-us.apache.org/repos/asf/tika/tree/b3bf5141 Diff: http://git-wip-us.apache.org/repos/asf/tika/diff/b3bf5141 Branch: refs/heads/2.x Commit: b3bf5141b6c67fde704fdb25debdb564df5d0394 Parents: 60d4e3f Author: tballison <talli...@mitre.org> Authored: Wed Jun 15 09:27:09 2016 -0400 Committer: tballison <talli...@mitre.org> Committed: Wed Jun 15 09:27:09 2016 -0400 ---------------------------------------------------------------------- .../org/apache/tika/parser/microsoft/MSOwnerFileParser.java | 9 ++++----- .../apache/tika/parser/microsoft/MSOwnerFileParserTest.java | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tika/blob/b3bf5141/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/microsoft/MSOwnerFileParser.java ---------------------------------------------------------------------- diff --git a/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/microsoft/MSOwnerFileParser.java b/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/microsoft/MSOwnerFileParser.java index 02c07a6..6d45adb 100644 --- a/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/microsoft/MSOwnerFileParser.java +++ b/tika-parser-modules/tika-parser-office-module/src/main/java/org/apache/tika/parser/microsoft/MSOwnerFileParser.java @@ -35,7 +35,7 @@ import java.util.Set; /** * Parser for temporary MSOFfice files. - * This currently only extracts the owner's name. + * This currently only extracts the last-modifier's name. */ public class MSOwnerFileParser extends AbstractParser { @@ -53,7 +53,7 @@ public class MSOwnerFileParser extends AbstractParser { } /** - * Extracts owner from MS temp file + * Extracts last-modifier's name from MS temp file */ public void parse( InputStream stream, ContentHandler handler, @@ -66,15 +66,14 @@ public class MSOwnerFileParser extends AbstractParser { IOUtils.readFully(stream, asciiNameBytes); int asciiNameLength = (int)asciiNameBytes[0];//don't need to convert to unsigned int because it can't be that long String asciiName = new String(asciiNameBytes, 1, asciiNameLength, StandardCharsets.US_ASCII); - metadata.set(TikaCoreProperties.CREATOR, asciiName); - + metadata.set(TikaCoreProperties.MODIFIER, asciiName); int unicodeCharLength = stream.read(); if (unicodeCharLength > 0) { stream.read();//zero after the char length byte[] unicodeBytes = new byte[unicodeCharLength * 2]; IOUtils.readFully(stream, unicodeBytes); String unicodeName = new String(unicodeBytes, StandardCharsets.UTF_16LE); - metadata.set(TikaCoreProperties.CREATOR, unicodeName); + metadata.set(TikaCoreProperties.MODIFIER, unicodeName); } xhtml.endDocument(); } http://git-wip-us.apache.org/repos/asf/tika/blob/b3bf5141/tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/microsoft/MSOwnerFileParserTest.java ---------------------------------------------------------------------- diff --git a/tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/microsoft/MSOwnerFileParserTest.java b/tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/microsoft/MSOwnerFileParserTest.java index 3cef3df..54a5f42 100644 --- a/tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/microsoft/MSOwnerFileParserTest.java +++ b/tika-parser-modules/tika-parser-office-module/src/test/java/org/apache/tika/parser/microsoft/MSOwnerFileParserTest.java @@ -26,6 +26,6 @@ public class MSOwnerFileParserTest extends TikaTest { @Test public void testBasic() throws Exception { XMLResult r = getXML("testMSOwnerFile"); - assertEquals("heidi", r.metadata.get(TikaCoreProperties.CREATOR)); + assertEquals("heidi", r.metadata.get(TikaCoreProperties.MODIFIER)); } }