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

[feature] Make sure to correctly resolve binary resources from the database as well as XML resources #977

Merged
merged 2 commits into from
Apr 17, 2016

Conversation

adamretter
Copy link
Member

Closes #952

@adamretter adamretter added the enhancement new features, suggestions, etc. label Apr 16, 2016
@dizzzz
Copy link
Member

dizzzz commented Apr 17, 2016

an error popped up:

    [javac] /home/travis/build/eXist-db/exist/src/org/exist/xquery/functions/transform/ExistUriResolver.java:47: error: class EXistURIResolver is public, should be declared in a file named EXistURIResolver.java

* Simplify a path removing any "." and ".." path elements.
* Assumes an absolute path is given.
*/
private String normalizePath(final String path) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I 'd hope that such a method would already exist either in our codebase or in an e.g. apache library :-)
It is probably useful on several locations.....

Copy link
Member Author

@adamretter adamretter Apr 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dizzzz I added a commit to remove some dead code which did nothing previously. This code was previously a sub-class in org.exist.xquery.functions.transform.Transform, I just moved it out and extended it to be more flexible.

There is also the org.exist.validation.resolver.unstable.ExistResolver which you added but it is marked unstable and the validation code can lead to deadlocks - #558

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I marked unstable because it was work in progress, but was not really finished over time :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dizzzz Okay, if it is unused should we remove it? If not perhaps switch to using the one I extended?

Copy link
Member

@dizzzz dizzzz Apr 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sounds good. your code looks much better.... You have used some constructs I need to study :-)

@adamretter
Copy link
Member Author

@dizzzz I fixed the file naming issue... I hate the fact that filenames on OSX filesystem are case-insensitive but preserving, I mean who decided that was even remotely a good idea???

@adamretter adamretter added this to the eXist-3.0 milestone Apr 17, 2016
@dizzzz
Copy link
Member

dizzzz commented Apr 17, 2016

yes, it s*cks ; you can actually switch it off, but that might have serious consequences.

@dizzzz dizzzz merged commit 8f67d5c into eXist-db:develop Apr 17, 2016
final Source source;
if (doc instanceof BinaryDocument) {
final Path p = broker.getBinaryFile((BinaryDocument) doc);
source = new StreamSource(p.toFile());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

he...... do we have here direct access to the Files deep down in WEBINF/data ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we have direct access to binary files in WEB-INF/data/fs for the purpose of reading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new features, suggestions, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants