本文整理汇总了Java中org.jboss.shrinkwrap.api.Filter类的典型用法代码示例。如果您正苦于以下问题:Java Filter类的具体用法?Java Filter怎么用?Java Filter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Filter类属于org.jboss.shrinkwrap.api包,在下文中一共展示了Filter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDeployments
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2278.war");
archive
.addManifest()
.addPackages(false, new Filter<ArchivePath> () {
@Override
public boolean include(ArchivePath path)
{
return !path.get().contains("TestCase");
}}, "org.jboss.test.ws.jaxws.jbws2278")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2278/WEB-INF/jboss-web.xml"), "jboss-web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2278/WEB-INF/wsdl/Test.wsdl"), "wsdl/Test.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2278/WEB-INF/web.xml"));
return archive;
}
示例2: createAuxiliaryArchive
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Override
public Archive<?> createAuxiliaryArchive() {
Collection<JavaArchive> archives = new ArrayList<>();
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File(
"../lib/bdd/jbehave-core-3.8-SNAPSHOT.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File("../lib/bdd/xstream-1.4.4.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File("../lib/bdd/paranamer-2.4.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File(
"../lib/javassist/javassist-3.15.0-GA.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File("../lib/bdd/freemarker-2.3.19.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File("../lib/bdd/plexus-utils-3.0.10.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class,
new File("../lib/bdd/hamcrest-integration-1.1.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File("../lib/bdd/hamcrest-core-1.1.jar")));
archives.add(ShrinkWrap.createFromZipFile(JavaArchive.class, new File("../lib/bdd/xpp3_min-1.1.4c.jar")));
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "arquillian-jbehave.jar");
Filter<ArchivePath> filter = Filters.exclude("/META-INF.*");
for (Archive<JavaArchive> element : archives) {
archive.merge(element, filter);
}
return archive;
}
示例3: findResources
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
private Collection<Resource> findResources(final String path, final String suffix) {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
final Collection<Resource> resources = new ArrayList<Resource>();
if (SWClassLoader.class.isInstance(loader)) {
final Collection<Archive<?>> archives = SWClassLoader.class.cast(loader).getArchives();
final ClassLoader parent = loader.getParent();
for (final Archive<?> archive : archives) {
final Map<ArchivePath, Node> content = archive.getContent(new Filter<ArchivePath>() {
@Override
public boolean include(final ArchivePath object) {
final String currentPath = classloaderPath(object);
return !(parent != null && parent.getResource(currentPath) != null)
&& currentPath.startsWith('/' + path) && currentPath.endsWith(suffix);
}
});
for (final Map.Entry<ArchivePath, Node> entry : content.entrySet()) {
resources.add(new SWResource(entry.getKey(), entry.getValue()));
}
}
}
return resources;
}
示例4: createDeployment
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-cxf-jbws3516.war");
archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.apache.cxf.impl\n"))
.addPackages(false, new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath object)
{
return !object.get().contains("TestCase");
}}, "org.jboss.test.ws.jaxws.cxf.jbws3516")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3516/WEB-INF/wsdl/hello_world.wsdl"), "wsdl/hello_world.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3516/WEB-INF/web.xml"));
return archive;
}
示例5: createDeployments
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-calendar.war");
archive
.addManifest()
.addPackages(false, new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath path)
{
return !path.get().contains("TestCase");
}
}, "org.jboss.test.ws.jaxws.calendar");
return archive;
}
示例6: createDeployments
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-date.war");
archive
.addManifest()
.addPackages(false, new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath path)
{
return !path.get().contains("TestCase");
}
}, "org.jboss.test.ws.jaxws.date");
return archive;
}
示例7: createDeployments
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws3552.war");
archive
.addManifest()
.addPackages(false, new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath path)
{
return !path.get().contains("TestCase");
}}, "org.jboss.test.ws.jaxws.jbws3552");
return archive;
}
示例8: createDeployments
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-complex.war");
archive
.addManifest()
.addPackages(false, new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath path)
{
return !path.get().contains("TestCase");
}
}, "org.jboss.test.ws.jaxws.complex")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/complex/WEB-INF/web.xml"));
return archive;
}
示例9: applyFilter
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
private Filter<ArchivePath> applyFilter(
WarPluginConfiguration warPluginConfiguration) {
final List<String> filesToIncludes = Arrays.asList(
includesFiles(
warPluginConfiguration.getWarSourceDirectory(),
warPluginConfiguration.getExcludes()));
return new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath archivePath) {
final String strFilePath = archivePath.get();
if (filesToIncludes.contains(strFilePath)) {
return true;
}
for (String fileToInclude : filesToIncludes) {
if (fileToInclude.startsWith(strFilePath)) {
return true;
}
}
return false;
}
};
}
示例10: createFilter
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected Filter<ArchivePath> createFilter(WebArchive uber, WebArchive archive) throws Exception {
if (filterClass != null) {
return (Filter<ArchivePath>) MultiContext.newInstance(ScanStrategy.class.getClassLoader(), filterClass, new Object[]{uber, archive}, new Class[]{WebArchive.class, WebArchive.class});
} else {
return new WarningFilter(uber, archive);
}
}
示例11: KnownResourcesFilter
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
public KnownResourcesFilter(final File base, final String prefix, final Filter<ArchivePath> filter) {
this.base = base;
this.delegate = filter;
if (prefix.startsWith("/")) {
this.prefix = prefix.substring(1);
} else {
this.prefix = prefix;
}
}
示例12: createTestArchive
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Deployment
public static Archive<?> createTestArchive() throws FileNotFoundException {
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "agorava-empireavenue.jar")
.addPackages(true, new Filter<ArchivePath>() {
@Override
public boolean include(ArchivePath path) {
return !((path.get().contains("test") || path.get().contains("servlet") || path.get().contains
("jsf")));
}
}, "org.agorava")
.addAsResource("META-INF/services/javax.enterprise.inject.spi.Extension")
.addAsResource("META-INF/services/org.apache.deltaspike.core.spi.config.ConfigSourceProvider")
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
JavaArchive[] libs = Maven.resolver()
.loadPomFromFile("pom.xml")
.resolve("org.apache.deltaspike.core:deltaspike-core-impl")
.withTransitivity().as(JavaArchive.class);
WebArchive ret = ShrinkWrap
.create(WebArchive.class, "test.war")
.addClasses(EmpireAvenueServiceProducer.class)
.addAsLibraries(libs)
.addAsLibraries(testJar)
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsWebInfResource("agorava.properties");
return ret;
}
示例13: getAsType
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Override
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type,
Filter<ArchivePath> filter) {
throw new UnsupportedOperationException("Operation not supported for Undertow Archive.");
}
示例14: getContent
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Override
public Map<ArchivePath, Node> getContent(Filter<ArchivePath> filter) {
throw new UnsupportedOperationException("Operation not supported for Undertow Archive.");
}
示例15: merge
import org.jboss.shrinkwrap.api.Filter; //导入依赖的package包/类
@Override
public WebArchive merge(Archive<?> source, Filter<ArchivePath> filter)
throws IllegalArgumentException {
throw new UnsupportedOperationException("Operation not supported for Undertow Archive.");
}