Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4265

Fail to close stream in DefaultPropertiesResolver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7.3, 2.8.0
    • 2.8.1, 2.9.0
    • camel-core
    • None
    • Any

    Description

      protected Properties loadPropertiesFromFilePath(CamelContext context, String path) throws IOException {
      if (path.startsWith("file:"))

      { path = ObjectHelper.after(path, "file:"); }

      InputStream is = new FileInputStream(path);
      Properties answer = new Properties();
      answer.load(is);
      return answer;
      }

      Stream not closed before return, as well as in another method: loadPropertiesFromClasspath.

      Attachments

        1. close_inputstream.patch
          1 kB
          edge wang
        2. close_inputstream.patch
          1 kB
          edge wang

        Activity

          People

            davsclaus Claus Ibsen
            edge edge wang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: