[forge-dev] Resource File Path

Luca Masini luca.masini.mailing.list at gmail.com
Thu Dec 6 15:21:03 EST 2012


Ok, I looked into the Resource API that uses java.io.File. Inside that a
call to "normalize" that handle the path separator.

So I can use the method you suggested.

Thank you


2012/12/6 Lincoln Baxter, III <lincolnbaxter at gmail.com>

> I believe the Resource API handles that.
>
>
>
> On Thu, Dec 6, 2012 at 3:09 PM, Luca Masini <
> luca.masini.mailing.list at gmail.com> wrote:
>
>> This utility method always convert "." to "/", don't we need to account
>> for Windows's "\" ??
>>
>>
>> 2012/12/6 Lincoln Baxter, III <lincolnbaxter at gmail.com>
>>
>> I believe there is a utility class called Packages.toFileSyntax() -
>>> https://github.com/forge/core/blob/master/shell-api/src/main/java/org/jboss/forge/shell/util/Packages.java#L23
>>>
>>>
>>> On Thu, Dec 6, 2012 at 5:51 AM, Luca Masini <luca.masini at gmail.com>wrote:
>>>
>>>> Hi guys, I need to write a resource into the src/main/resources file
>>>> that is related to a class MyForm.
>>>>
>>>> I'm using this code but it smells:
>>>>
>>>> resource.getResource(viewBean.getQualifiedName().replace('.',
>>>> File.separatorChar)+".html")
>>>>
>>>> Suggestions about the best way to do that ??
>>>>
>>>> Thank you.
>>>>
>>>> --
>>>> ****************************************
>>>> http://www.lucamasini.net
>>>> http://twitter.com/lmasini
>>>> http://www.linkedin.com/pub/luca-masini/7/10/2b9
>>>> ****************************************
>>>>
>>>> _______________________________________________
>>>> forge-dev mailing list
>>>> forge-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Lincoln Baxter, III
>>> http://ocpsoft.org
>>> "Simpler is better."
>>>
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>
>>>
>>
>>
>> --
>> ****************************************
>> http://www.lucamasini.net
>> http://twitter.com/lmasini
>> http://www.linkedin.com/pub/luca-masini/7/10/2b9
>> ****************************************
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>


-- 
****************************************
http://www.lucamasini.net
http://twitter.com/lmasini
http://www.linkedin.com/pub/luca-masini/7/10/2b9
****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20121206/2b0fd07c/attachment.html 


More information about the forge-dev mailing list