Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File type check requires file ending #2

Open
Schmoho opened this issue Jul 22, 2024 · 1 comment
Open

File type check requires file ending #2

Schmoho opened this issue Jul 22, 2024 · 1 comment

Comments

@Schmoho
Copy link

Schmoho commented Jul 22, 2024

The code referenced below requires a file to both have the proper file name ending and for its content to be proper SBML/SBGN.
This seems unnecessarily restrictive to me, as the second check is arguably stronger - i.e. this could well do with "logical or" instead of "and".

https://github.com/draeger-lab/SysBio/blob/2d6520704440397ab7fcf0b59d6adbdd82942b1a/src/de/zbit/io/filefilter/SBFileFilter.java#L911C1-L925C4

This came up in downstream development on the ModelPolisher.

@Clemens82
Copy link
Contributor

My two cents:
Yes, a logical or would be less restrictive and also detect correct files even if they have a different extension.

However, please consider the architectural design of those filefilters. Aren't they applied as soon as the browser window is opening a folder? Consider a folder with thousands of files. The second check would require the filefilter to open all those files in order to do a content base check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants