public static void addFile(JavaArchive archive, String originalPath) { archive.addAsResource(new UrlAsset(Thread.currentThread().getContextClassLoader().getResource("internal/" + originalPath)), originalPath); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.container.ManifestContainer#setManifest(java.net.URL) */ @Override public T setManifest(URL resource) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); return setManifest(new UrlAsset(resource)); }
@Override public T setResourceAdapterXML(URL resource) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); return setResourceAdapterXML(new UrlAsset(resource)); }
@Override public T setApplicationXML(URL resource) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); return setApplicationXML(new UrlAsset(resource)); }
@Override public T setWebXML(URL resource) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); return setWebXML(new UrlAsset(resource)); }
@Override public T setApplicationXML(URL resource) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); return setApplicationXML(new UrlAsset(resource)); }
@Override public T setWebXML(URL resource) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); return setWebXML(new UrlAsset(resource)); }
@Override public T addAsResource(URL resource, ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); File file = new File(resource.getFile()); if (file.exists()) { return addAsResource(file, target); } return addAsResource(new UrlAsset(resource), target); }
@Override public T addAsManifestResource(URL resource, ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); File file = new File(resource.getFile()); if (file.exists()) { return addAsManifestResource(file, target); } return addAsManifestResource(new UrlAsset(resource), target); }
@Override public T addAsModule(final URL resource, final ArchivePath targetPath) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); Validate.notNull(targetPath, "Target Path must be specified"); Asset asset = new UrlAsset(resource); return addAsModule(asset, targetPath); }
@Override public T addAsWebResource(URL resource, String target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); return addAsWebResource(new UrlAsset(resource), target); }
/** * {@inheritDoc} * * @see SpringBootContainer#addAsBootInfResource(URL, String) */ @Override public T addAsBootInfResource(final URL resource, final String target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNullOrEmpty(target, "Target should be specified"); return addAsBootInfResource(new UrlAsset(resource), target); }
@Override public T addAsWebResource(URL resource, ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); return addAsWebResource(new UrlAsset(resource), target); }
@Override public T addAsApplicationResource(URL resource, ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); Validate.notNull(target, "Target must be specified"); return addAsApplicationResource(new UrlAsset(resource), target); }
@Override public T addAsWebResource(URL resource, String target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); return addAsWebResource(new UrlAsset(resource), target); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.container.WebContainer#addAsWebInfResource(java.net.URL, * org.jboss.shrinkwrap.api.ArchivePath) */ @Override public T addAsWebInfResource(final URL resource, final ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); return addAsWebInfResource(new UrlAsset(resource), target); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.container.WebContainer#addAsWebInfResource(java.net.URL, java.lang.String) */ @Override public T addAsWebInfResource(final URL resource, final String target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNullOrEmpty(target, "Target should be specified"); return addAsWebInfResource(new UrlAsset(resource), target); }
@Override public T addAsApplicationResource(URL resource, String target) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); Validate.notNull(target, "Target must be specified"); return addAsApplicationResource(new UrlAsset(resource), target); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.container.WebContainer#addAsWebInfResource(java.net.URL, * org.jboss.shrinkwrap.api.ArchivePath) */ @Override public T addAsWebInfResource(final URL resource, final ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNull(target, "Target should be specified"); return addAsWebInfResource(new UrlAsset(resource), target); }
@Override public T addAsApplicationResource(URL resource, ArchivePath target) throws IllegalArgumentException { Validate.notNull(resource, "Resource must be specified"); Validate.notNull(target, "Target must be specified"); return addAsApplicationResource(new UrlAsset(resource), target); }