Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-1539

XWiki.cfg should be read as a resource if it fails to be retrieved using a direct file access

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1 M3
    • Fix Version/s: 1.1 M4
    • Component/s: {Unused} Core
    • Labels:
      None
    • Similar issues:

      Description

                          InputStream xwikicfgis = null;
      
                          // first try to load the file pointed by the given path
                          // if it does not exist, look for it relative to the classpath
                          File f = new File(xwikicfg);
                          if (f.exists()) {
                              xwikicfgis = new FileInputStream(f);
                          } else {
                              xwikicfgis = econtext.getResourceAsStream(xwikicfg);
      ...
      

      We need to catch an IOException on "new FileInputStream".

      At the same refactor the code to be clean.

        Attachments

          Activity

            People

            Assignee:
            vmassol Vincent Massol
            Reporter:
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: