[forge-issues] [JBoss JIRA] (FORGE-2223) Unable to create xhtml file

Michael Schwartz (JIRA) issues at jboss.org
Sat Feb 7 04:48:48 EST 2015


     [ https://issues.jboss.org/browse/FORGE-2223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Schwartz updated FORGE-2223:
------------------------------------
    Description: 
When creating a file with extension ".xhtml" with the following code the returned XMLResource is null. However creating the same file with extension "xml" works. 

XMLResource config = resourceFactory.create(XMLResource.class, new File(project.toString() + "/src/main/resources/" + filename));

imho the create() method should produce an exception containing the cause of the error instead of returning null, it would simplify bugfixing. 

Furthermore the code getParent().mkdirs(); (2 occurences) in org.jboss.forge.addon.resource.AbstractFileResource may (and do) produce NullPointerExceptions.

Is there any suggestion to get the base resource directory via code instead of hardcoding it to "project.toString() + "/src/main/resources"?

thanks and regards from austria, Mike

  was:
When creating a file with extension ".xhtml" with the following code the returned XMLResource is null. However creating the same file with extension "xml" works. 

XMLResource config = resourceFactory.create(XMLResource.class, new File(project.toString() + "/src/main/resources/" + filename));

imho the create() method should produce an exception containing the cause of the error instead of doing nothing, it would simplify bugfixing. 

Furthermore the code getParent().mkdirs(); (2 occurences) in org.jboss.forge.addon.resource.AbstractFileResource may (and do) produce NullPointerExceptions.

Is there any suggestion to get the base resource directory via code instead of hardcoding it to "project.toString() + "/src/main/resources"?

thanks and regards from austria, Mike



> Unable to create xhtml file
> ---------------------------
>
>                 Key: FORGE-2223
>                 URL: https://issues.jboss.org/browse/FORGE-2223
>             Project: Forge
>          Issue Type: Bug
>          Components: Addon Development
>    Affects Versions: 2.13.0.Final
>            Reporter: Michael Schwartz
>
> When creating a file with extension ".xhtml" with the following code the returned XMLResource is null. However creating the same file with extension "xml" works. 
> XMLResource config = resourceFactory.create(XMLResource.class, new File(project.toString() + "/src/main/resources/" + filename));
> imho the create() method should produce an exception containing the cause of the error instead of returning null, it would simplify bugfixing. 
> Furthermore the code getParent().mkdirs(); (2 occurences) in org.jboss.forge.addon.resource.AbstractFileResource may (and do) produce NullPointerExceptions.
> Is there any suggestion to get the base resource directory via code instead of hardcoding it to "project.toString() + "/src/main/resources"?
> thanks and regards from austria, Mike



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the forge-issues mailing list