Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9479

Use FlexibleLocation.resolveLocation() instead of hard-coded path

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Release
    • Component/s: ALL COMPONENTS
    • Labels:
      None

      Description

      I found some occurrences where file path URL is prepared using the actual path of the file rather than the relative path. For e.g.

      String imgPropertyFullPath = System.getProperty("ofbiz.home") + "/applications/product/config/ImageProperties.xml";
      

      IMO the location URL of files should be prepared dynamically using relative paths and this can be achieved by using
      FlexibleLocation.resolveLocation() method. This method covers all the scenarios and in future, if we want to change anything, then all we need is to update the method and all instances will be fixed.

      1. OFBIZ-9479.patch
        5 kB
        Devanshu Vyas

        Activity

        Hide
        devanshu.vyas Devanshu Vyas added a comment -

        Uploaded patch with fixes to use FlexibleLocation.resolveLocation() method in place of hard-coded URL path preparation.

        Show
        devanshu.vyas Devanshu Vyas added a comment - Uploaded patch with fixes to use FlexibleLocation.resolveLocation() method in place of hard-coded URL path preparation.
        Hide
        toashishvijay Ashish Vijaywargiya added a comment -

        Thanks Devanshu for the contribution.
        Changes are committed in trunk at r1802673.

        Show
        toashishvijay Ashish Vijaywargiya added a comment - Thanks Devanshu for the contribution. Changes are committed in trunk at r1802673.

          People

          • Assignee:
            toashishvijay Ashish Vijaywargiya
            Reporter:
            devanshu.vyas Devanshu Vyas
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development