GeoTools
  1. GeoTools
  2. GEOT-4122

Properties files don't escape "|"s

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0-RC1
    • Component/s: None
    • Labels:
      None

      Description

      When reading and writing properties files there is no allowance for the data to contain "|".

        Activity

        Hide
        Jody Garnett added a comment -
        I don't really find this patch pretty - I had one pretty solution with a regex: [.-\\]| but it failed to handle a string of the form "|foo"

        The test cases show it working; and I also added a few extra tests around the handling of "multi-line" values in a property file. We have two solutions in the current code base. One based on a search and replace of "\\n" with "\n" and the second based on supporting lines ending with "\\" as per the property file spec.
        Show
        Jody Garnett added a comment - I don't really find this patch pretty - I had one pretty solution with a regex: [.-\\]| but it failed to handle a string of the form "|foo" The test cases show it working; and I also added a few extra tests around the handling of "multi-line" values in a property file. We have two solutions in the current code base. One based on a search and replace of "\\n" with "\n" and the second based on supporting lines ending with "\\" as per the property file spec.
        Hide
        Andrea Aime added a comment -
        Ugh, the patch is full of reformats. Patches should be submitted so that only the actual code changes show up. Please don't reformat the code and/or disable automatic reformats?
        Show
        Andrea Aime added a comment - Ugh, the patch is full of reformats. Patches should be submitted so that only the actual code changes show up. Please don't reformat the code and/or disable automatic reformats?
        Hide
        Jody Garnett added a comment - - edited
        That splitIntoText method was mostly rewritten. I have confirmed that the patch does not harm with respect to geoserver build.

        Proceeding to work on writer.
        Show
        Jody Garnett added a comment - - edited That splitIntoText method was mostly rewritten. I have confirmed that the patch does not harm with respect to geoserver build. Proceeding to work on writer.
        Hide
        Jody Garnett added a comment -
        Okay I am getting tired of the long testing process. While I can pass tests in GeoTools; geoserver seems troubled for me today (but was not yesterday).

        The patch is easier to follow and I have separated out the string encode and string decode methods in order to focus on them.

        I am blocked from making property data store be able to handle any string by reason of the txt.repalce("\\n","\n") statements. With that in the mix I have not been smart enough with regular expressions to undo the damage caused.
        Show
        Jody Garnett added a comment - Okay I am getting tired of the long testing process. While I can pass tests in GeoTools; geoserver seems troubled for me today (but was not yesterday). The patch is easier to follow and I have separated out the string encode and string decode methods in order to focus on them. I am blocked from making property data store be able to handle any string by reason of the txt.repalce("\\n","\n") statements. With that in the mix I have not been smart enough with regular expressions to undo the damage caused.
        Hide
        Jody Garnett added a comment -
        Fixed on trunk -r38699

        Full geoserver tests pass; earlier problems were resolved by clearing repository.
        Show
        Jody Garnett added a comment - Fixed on trunk -r38699 Full geoserver tests pass; earlier problems were resolved by clearing repository.

          People

          • Assignee:
            Mark Leslie
            Reporter:
            Paul Pfeiffer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: