You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Robert Muir (Jira)" <ji...@apache.org> on 2022/04/20 02:05:00 UTC

[jira] [Created] (LUCENE-10526) add single method to mockfile to wrap a Path

Robert Muir created LUCENE-10526:
------------------------------------

             Summary: add single method to mockfile to wrap a Path
                 Key: LUCENE-10526
                 URL: https://issues.apache.org/jira/browse/LUCENE-10526
             Project: Lucene - Core
          Issue Type: Sub-task
            Reporter: Robert Muir


Currently, mockfilesystems wrap a path with "new FilterPath". but this "wrapping" logic is scattered everywhere in the code (and tests!). And it is hardcoded at filterpath (subclassing is not possible).

This makes it impossible for a mock filesystem to extend FilterPath with some custom logic (example: check for special windows reserved characters).

I don't think code/tests should be calling "new FilterPath" everywhere, this is also just messy. Instead they should ask the mockfilesystem's provider to wrap the path: {{provider.wrapPath(path, filesystem)}}.

This way, WindowsFS can then override wrapPath() with a subclass that looks for special characters.

This issue is just for the API refactoring/cleanup. Additional Windows-simulation can happen on the parent issue.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org