You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Hudson (Jira)" <ji...@apache.org> on 2022/06/02 12:11:00 UTC

[jira] [Commented] (TIKA-3783) Filename detection misses when a # and several . are in a filename

    [ https://issues.apache.org/jira/browse/TIKA-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17545447#comment-17545447 ] 

Hudson commented on TIKA-3783:
------------------------------

SUCCESS: Integrated in Jenkins build Tika ยป tika-main-jdk8 #625 (See [https://ci-builds.apache.org/job/Tika/job/tika-main-jdk8/625/])
TIKA-3783 -- fix name detector to handle # before final . (tallison: [https://github.com/apache/tika/commit/cfe6c2b0175a98c209cec99090d01bc2e19aefec])
* (edit) tika-core/src/main/java/org/apache/tika/detect/NameDetector.java
* (edit) tika-core/src/test/java/org/apache/tika/detect/NameDetectorTest.java


> Filename detection misses when a # and several . are in a filename
> ------------------------------------------------------------------
>
>                 Key: TIKA-3783
>                 URL: https://issues.apache.org/jira/browse/TIKA-3783
>             Project: Tika
>          Issue Type: Bug
>          Components: detector
>         Environment: java 8
> [TIKA-1928|https://issues.apache.org/jira/browse/TIKA-1928]
>            Reporter: Alexander
>            Priority: Minor
>             Fix For: 2.4.1
>
>
> NameDetector.detect() strip any fragments after #, but not only after extension, when filename contains dots and hashes.
> Example: 'ABC#192.168.0.1#2.xxx' will be stripped to 'ABC#192.168.0.1'.
> There are filenames that contains dots not only in extension.
> Should change line:
> {code:java}
> int dot = name.indexOf('.')
> {code}
> [https://github.com/apache/tika/blob/a52e4d153e950077f7fdedadcc5d75604fe2563d/tika-core/src/main/java/org/apache/tika/detect/NameDetector.java#L119]
> to:
> {code:java}
> int dot = name.lastIndexOf('.');
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)