Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 56936 invoked from network); 10 Mar 2008 19:32:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2008 19:32:15 -0000 Received: (qmail 39697 invoked by uid 500); 10 Mar 2008 19:32:09 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 39605 invoked by uid 500); 10 Mar 2008 19:32:09 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 39577 invoked by uid 99); 10 Mar 2008 19:32:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 12:32:09 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 19:31:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 65958234C092 for ; Mon, 10 Mar 2008 12:30:46 -0700 (PDT) Message-ID: <1304073386.1205177446415.JavaMail.jira@brutus> Date: Mon, 10 Mar 2008 12:30:46 -0700 (PDT) From: "Robert Scholte (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (LANG-417) ClassUtils: method for turning FQN into resource path In-Reply-To: <36631316.1205037586150.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577134#action_12577134 ] Robert Scholte commented on LANG-417: ------------------------------------- Maybe this requires a PackageUtils, because it's got nothing to do with the class itself but just with it's package. I think the most logic method would be public static String toResourcePath(Package p)... public static String toResourcePath(Package p, String fqName) ... this has to be combined with: public static Package getPackage(Class clazz) and yes, this would mean a new class: Package. although it would require 2 steps, the methods would be very clear. IMHO the suggested methodnames are just too ugly. > 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 > Reporter: Paul Benedict > Fix For: 2.4 > > > 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(); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.