[
https://issues.apache.org/jira/browse/LANG-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13874712#comment-13874712
]
Woonsan Ko commented on LANG-417:
---------------------------------
Good point.
{{ClasspathUtils}} seems better to me because many frameworks have used
'classpath:' url scheme already and so 'ClasspathUtils' seems connected to that
to me.
Also, I wasn't fully happy with 'toAbsoluteName' either even though it was
copied from the javadoc.
So, how about this then? The names are longer, but it looks clearer than
'AbsoluteResource[Name|Path]' to me. :-)
{code}
public class ClasspathUtils {
public static String toFullyQualifiedResourceName(Package context, name);
public static String toFullyQualifiedResourceName(Class context, name);
}
{code}
> ClassUtils: method for turning FQN into resource path
> -----------------------------------------------------
>
> Key: LANG-417
> URL: https://issues.apache.org/jira/browse/LANG-417
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.*
> Reporter: Paul Benedict
> Assignee: Benedikt Ritter
> Fix For: 3.3, Patch Needed
>
>
> I commonly need a FQ path to a resource within the same location as a class
> file. I recommend the addition of this method:
> {code:java}
> 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();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)