Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-417

New class ClassPathUtils with methods for turning FQN into resource path

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.3
    • lang.*
    • None

    Description

      I commonly need a FQ path to a resource within the same location as a class file. I recommend the addition of this method:

      public String getPackageResourcePath(Class clazz, String resourceName)
          StringBuffer buf = new StringBuffer();
          buf.append(ClassUtils.getPackageName(getClass()).replace('.', '/'));
          buf.append("/");
          buf.append(resourceName);
          return  buf.toString();
      }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            britter Benedikt Ritter
            pbenedict Paul Benedict
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment