lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Updated] (LUCENE-5906) Use Files.delete instead of File.delete + made up exception
Date Thu, 04 Sep 2014 00:12:53 GMT


Robert Muir updated LUCENE-5906:
    Attachment: LUCENE-5906.patch

Updated patch, with full cutover to Files.delete() (and File.delete() banned in forbidden

This forced me to review all code deleting files, and I had to plug some leaks in suggesters,
hunspell, offline sorter.

Additionally to prevent such leaks, i had to add some IOUtils methods like deleteFilesIgnoringExceptions
and so on. 

I moved TestUtil.rm to IOUtils, and fixed its exception messaging to return the actual exception
messages for each file it couldnt delete. This is now used several places in source too (that
had their own duplicate "rm" methods).

I think we should do this as a step, because deleting files is about the most dangerous thing
our code can do. So we really need real exceptions here in case something goes bad.

Later we should investigate what Uwe suggests (Path api). This would be good to look at for
lucene 5, but this patch is heavy enough.

> Use Files.delete instead of File.delete + made up exception
> -----------------------------------------------------------
>                 Key: LUCENE-5906
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-5906.patch, LUCENE-5906.patch
> We are on java7, if we cannot delete a file, this one returns a real exception as to

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message