[
https://issues.apache.org/jira/browse/TIKA-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14904388#comment-14904388
]
Tim Allison commented on TIKA-1744:
-----------------------------------
Thank you, [~kunda]!
I think this was part of the earlier discussion...
In the current patch, we have
{noformat}
public static TikaInputStream get(File file, Metadata metadata)
throws FileNotFoundException {
{noformat}
which calls {{new TikaInputStream(File file)}}.
It would be great if we could do a complete transfer to Path. However, as you
found, we can't just change this under the hood:
{noformat}
public static TikaInputStream get(File file, Metadata metadata)
throws FileNotFoundException {
return get(Paths.get(file.toURI()), metadata);
}
{noformat}
because {{get(Path path}} throws the more general, well actually more specific
(and better!) IOException and its subclasses.
I'm wondering if we should deprecate {{get(File file...) throws FNFE}} so that
we can add {{get(File file...) throws IOException}} in Tika 2.0 and do a small
amount of cleanup?
> Use java.nio.file.Path in TikaInputStream
> -----------------------------------------
>
> Key: TIKA-1744
> URL: https://issues.apache.org/jira/browse/TIKA-1744
> Project: Tika
> Issue Type: Sub-task
> Components: core
> Reporter: Yaniv Kunda
> Priority: Minor
> Fix For: 1.11
>
> Attachments: TIKA-1744.patch
>
>
> This will provide support for the new api for users who need it, and provide
> better information in I/O operations, e.g. detailed exception if file cannot
> be read.
> - used Path and methods in java.nio.file.Files internally
> - add getPath() method as the counterpart to getFile()
> - modified test to use
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)