Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-246

The method getBasePath() in FileConfiguration suggest other behavior than it is implemented

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      I have tried to use the FileConfiguration#getBasePath method without a look into the implementation. The documentation is not very useful because it says simple "returns the base path". For me the method suggest that a string for the configuration file "C:\myDir\config.file" in form "C:\myDir\" is returned. But the method returns the full path.

      I suggest to rename the method to getPath and give a documentation link to URL#getPath which does in fact the same. Or update the documentation which describes in more detail that this method returns the complete path for the associated file for this file configuration.

      A documentation entry can then looks like

      Returns the base path for the file associated with the current file configuration. The base path contains the full path to the file and the file itself.

      @see java.net.URL#getPath

        Attachments

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              waffel Thomas Wabner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: