Giter Club home page Giter Club logo

Comments (4)

lbane avatar lbane commented on August 10, 2024

I'm not sure about this. I think pathForResourceNamed must return a real filesystem path, and this does not work with URL like paths needed to locate files inside Jars.
For example ERXFileUtilities.pathForResourceNamed("Localizable.strings", "ERExtensions", NSArray.of("English")) may return something like file:///Users/auser/.m2/repository/wonder/core/ERExtensions/7.4.3/ERExtensions-7.4.3.jar!/Resources/English.lproj/Localizable.strings when the jar check is disabled. But this string is missing the jar: prefix that the real URL has, and is unusable for locating anything.

The URL version pathURLForResourceNamed should be used instead where appropriate. There are a few places, especially when locating property files, that currently still use pathForResourceNamed where the URL version might be better suited.

from wonder.

sal-bock avatar sal-bock commented on August 10, 2024

Well, both pathURLForResourceNamed and pathForResourceNamed will call application.resourceManager.pathURLForResourceNamed. So in a normal scenario they will return the same result. In addition, pathForResourceNamed will check if application is null and tries to look for the corresponding NSBunde to retrieve the pathURL.

Is there is a use case, where WOApplication.application() will return null: ERXProperties.applyConfiguration

from wonder.

sal-bock avatar sal-bock commented on August 10, 2024

It turns out, that ERXProperties fails to read the Properties during application startup (via EXProperties.applyConfiguration). But this is another issue. But at the end, all expected properties are loaded somehow.

from wonder.

sal-bock avatar sal-bock commented on August 10, 2024

I'm not sure about this. I think pathForResourceNamed must return a real filesystem path, and this does not work with URL like paths needed to locate files inside Jars. [...]

I finally see that there is subtile difference between url.getFile() and url.toExternalForm().

The URL version pathURLForResourceNamed should be used instead where appropriate. There are a few places, especially when locating property files, that currently still use pathForResourceNamed where the URL version might be better suited.

Ok, I will fix ERXNavigationManager.registerObserverForFramework, which will throw an NullPointerException, if the navigationMenuFile is contained in a jar.

from wonder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.