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

    • Bug
    • Resolution: Fixed
    • Minor
    • 1.1 M4
    • 1.1 M3
    • {Unused} Core
    • None

    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

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

            Dates

              Created:
              Updated:
              Resolved: