Camel
  1. Camel
  2. CAMEL-4813

Add a converter to turn StringBuffer to InputStream

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.5, 2.8.4, 2.9.1
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      As the user request[1], we need to consider to provide a converter for StringBuffer
      [1]http://camel.465427.n5.nabble.com/TypeConverter-for-StringBuilder-tp5092438p5092438.html

        Activity

        Hide
        Willem Jiang added a comment -

        Applied patch into trunk, camel-2.8.x and camel-2.7.x branches.

        Show
        Willem Jiang added a comment - Applied patch into trunk, camel-2.8.x and camel-2.7.x branches.
        Hide
        Babak Vahdat added a comment -

        Oops AbstractStringBuilder seems to be package private

        Show
        Babak Vahdat added a comment - Oops AbstractStringBuilder seems to be package private
        Hide
        Babak Vahdat added a comment -

        IMHO just changing the signature to:

        @Converter
        public static InputStream toInputStream(AbstractStringBuilder builder, Exchange exchange) throws IOException;
        

        should do the trick, so that we don't have to duplicate the code. However I haven't tried that and don't know if the Converter lookup-logic would support this dynamic type approach as well.

        Show
        Babak Vahdat added a comment - IMHO just changing the signature to: @Converter public static InputStream toInputStream(AbstractStringBuilder builder, Exchange exchange) throws IOException; should do the trick, so that we don't have to duplicate the code. However I haven't tried that and don't know if the Converter lookup-logic would support this dynamic type approach as well.
        Hide
        Claus Ibsen added a comment -

        Willem can you add for StringBuilder as well (there is both a StringBuffer and StringBuilder in the JDK)

        Show
        Claus Ibsen added a comment - Willem can you add for StringBuilder as well (there is both a StringBuffer and StringBuilder in the JDK)

          People

          • Assignee:
            Willem Jiang
            Reporter:
            Willem Jiang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development