[JBoss JIRA] (SHRINKWRAP-442) NPE when calling WebArchive.addAsResource(String, String) with a directory name
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/SHRINKWRAP-442?page=com.atlassian.jira.pl... ]
Aslak Knutsen edited comment on SHRINKWRAP-442 at 2/15/13 2:11 PM:
-------------------------------------------------------------------
The problem is, the resource is found on classpath inside a jar, but can't be opened as a Stream since it's not referring to a file. If it's found outside of a jar, a check earlier on will detect it's a directory and include it's children.
https://github.com/shrinkwrap/shrinkwrap/blob/master/impl-base/src/main/j...
At some point we need to detect that the ref is a directory and not a file based on naming and probably use the URLPackageScanner to scan for the children.
was (Author: aslak):
The problem is, the resource is found in classpath, but can't be opened as a Stream since it's not referring to a file.
https://github.com/shrinkwrap/shrinkwrap/blob/master/impl-base/src/main/j...
At some point we need to detect that the ref is a directory and not a file based on naming and probably use the URLPackageScanner to scan for the sub files.
> NPE when calling WebArchive.addAsResource(String, String) with a directory name
> -------------------------------------------------------------------------------
>
> Key: SHRINKWRAP-442
> URL: https://issues.jboss.org/browse/SHRINKWRAP-442
> Project: ShrinkWrap
> Issue Type: Bug
> Affects Versions: 1.0.1
> Reporter: Simon Lindgren
> Attachments: SHRINKWRAP-442-example-project.zip
>
>
> When calling WebArchive.addAsResource(String, String) with a path that is a directory, and that directory is on the classpath, but inside another jar, a NPE is thrown.
> The same kind of code works fine when run from inside the jar.
> I'll attach an example maven project that reproduces the issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 2 months