本文整理汇总了Java中org.jboss.shrinkwrap.api.asset.FileAsset类的典型用法代码示例。如果您正苦于以下问题:Java FileAsset类的具体用法?Java FileAsset怎么用?Java FileAsset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileAsset类属于org.jboss.shrinkwrap.api.asset包,在下文中一共展示了FileAsset类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addFilesToArchive
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
private void addFilesToArchive(final Path files, final DependenciesContainer<?> archive) throws Exception {
Files.walkFileTree(files, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path simple = files.relativize(file);
archive.add(new FileAsset(file.toFile()), "WEB-INF/classes/" + convertSeparators(simple));
// If the user's maven output is a jar then they may place
// static content under src/main/resources, in which case
// we need to hoist anything under WEB-INF out of there
// and put it into the root of this archive instead of
// under WEB-INF/classes/WEB-INF/foo
if (simple.toString().contains("WEB-INF")) {
archive.add(new FileAsset(file.toFile()), convertSeparators(simple));
}
return super.visitFile(file, attrs);
}
});
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:19,代码来源:DefaultWarDeploymentFactory.java
示例2: setupUsingAppPath
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
protected boolean setupUsingAppPath(Archive<?> archive) throws IOException {
final String appPath = System.getProperty(APP_PATH);
if (appPath != null) {
final Path path = Paths.get(appPath);
if (Files.isDirectory(path)) {
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path simple = path.relativize(file);
archive.add(new FileAsset(file.toFile()), convertSeparators(simple));
return super.visitFile(file, attrs);
}
});
} else {
archive.as(ZipImporter.class)
.importFrom(path.toFile());
}
return true;
}
return false;
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:24,代码来源:DefaultDeploymentFactory.java
示例3: setupUsingMaven
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Override
public boolean setupUsingMaven(Archive<?> archive) throws Exception {
FileSystemLayout fsLayout = FileSystemLayout.create();
final Path classes = fsLayout.resolveBuildClassesDir();
boolean success = false;
if (Files.exists(classes)) {
success = true;
Files.walkFileTree(classes, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path simple = classes.relativize(file);
archive.add(new FileAsset(file.toFile()), convertSeparators(simple));
return super.visitFile(file, attrs);
}
});
}
return success;
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:22,代码来源:DefaultJarDeploymentFactory.java
示例4: createDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-cxf-catalog.war");
archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.apache.cxf\n"))
.addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloRequest.class)
.addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloResponse.class)
.addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloWsImpl.class)
.addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.class)
.add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/catalog/META-INF/jax-ws-catalog.xml")), "META-INF/jax-ws-catalog.xml")
// stnd file locations required for successful deployment
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ "/jaxws/cxf/catalog/META-INF/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ "/jaxws/cxf/catalog/META-INF/wsdl/Hello_schema1.xsd"), "wsdl/Hello_schema1.xsd")
// sever side catalog maps to these files.
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ "/jaxws/cxf/catalog/META-INF/wsdl/HelloService.wsdl"), "wsdl/foo/HelloService.wsdl")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ "/jaxws/cxf/catalog/META-INF/wsdl/Hello_schema1.xsd"), "wsdl/foo/Hello_schema1.xsd");
JBossWSTestHelper.writeToFile(archive);
return archive;
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:25,代码来源:OasisCatalogHelloWSTestCase.java
示例5: createDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment(testable = false)
public static JavaArchive createDeployment() {
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-cxf-jbws3809.jar");
archive.addManifest()
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.BasicEjb.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.EjbPortComponentUri.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.EjbWebContext.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.EjbWebServiceNoServicename.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.dups.EjbWebServiceNoServicename.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.EjbWebServiceServicename.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.EjbWebServiceDupServicename.class)
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3809.EjbWebServiceProvider.class)
.add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3809/META-INF/jboss-webservices.xml")), "META-INF/jboss-webservices.xml")
.add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3809/META-INF/ejb-jar.xml")), "META-INF/ejb-jar.xml");
return archive;
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:17,代码来源:JBWS3809TestCase.java
示例6: setupUsingAppPath
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
protected boolean setupUsingAppPath(Archive<?> archive) throws IOException {
final String appPath = System.getProperty(BootstrapProperties.APP_PATH);
if (appPath != null) {
final Path path = Paths.get(appPath);
if (Files.isDirectory(path)) {
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path simple = path.relativize(file);
archive.add(new FileAsset(file.toFile()), convertSeparators(simple));
return super.visitFile(file, attrs);
}
});
} else {
archive.as(ZipImporter.class)
.importFrom(path.toFile());
}
return true;
}
return false;
}
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:24,代码来源:DefaultDeploymentFactory.java
示例7: setupUsingMaven
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Override
public boolean setupUsingMaven(Archive<?> archive) throws Exception {
Path pwd = Paths.get(System.getProperty("user.dir"));
final Path classes = pwd.resolve("target").resolve("classes");
boolean success = false;
if (Files.exists(classes)) {
success = true;
Files.walkFileTree(classes, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path simple = classes.relativize(file);
archive.add(new FileAsset(file.toFile()), convertSeparators(simple));
return super.visitFile(file, attrs);
}
});
}
//archive.addAllDependencies();
return success;
}
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:25,代码来源:DefaultJarDeploymentFactory.java
示例8: createTempDeploymentZip
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
private File createTempDeploymentZip() throws IOException {
// Reuse the test deployment and add the random content file
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test-http-deployment.jar")
.add(new FileAsset(randomContent), "file");
File temp = null;
try {
temp = File.createTempFile("test", "http-deployment");
archive.as(ZipExporter.class).exportTo(temp, true);
} catch (IOException e) {
if (temp != null) {
temp.delete();
}
throw e;
}
return temp;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:HttpGenericOperationUnitTestCase.java
示例9: addResources
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
private static void addResources(String source, String target, WebArchive archive) {
File sourceFile = new File(source);
if (! sourceFile.exists()) return;
if (sourceFile.isFile()) {
archive.add(new FileAsset(sourceFile), target);
}
if (sourceFile.isDirectory()) {
final File[] files = sourceFile.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().startsWith(".")) continue;
addResources(source + File.separator + file.getName(), target + File.separator + file.getName(), archive);
}
}
}
}
开发者ID:apache,项目名称:tomee,代码行数:18,代码来源:MoviesSeleniumTest.java
示例10: createTestArchive
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static WebArchive createTestArchive() {
return createTestArchiveBase()
// WEB-INF/templates
.addAsWebInfResource(new StringAsset("<html/>"),
"templates/foo.html")
.addAsWebInfResource(new StringAsset("<html/>"),
"templates/qux.html")
.addAsWebInfResource(new StringAsset("<xml/>"),
"templates/alpha.xml")
.addAsWebInfResource(new StringAsset("<html/>"),
"templates/cool/charlie.html")
// templates
.addAsWebResource(new StringAsset("<html/>"),
"templates/bart.html")
.addAsWebResource(new StringAsset("<html/>"),
"templates/html.html")
.addAsWebResource(
new FileAsset(new File(
"src/test/resources/locator/file/encoding.html")),
"templates/encoding.html")
.addAsLibraries(resolve("org.trimou:trimou-extension-servlet"));
}
开发者ID:trimou,项目名称:trimou,代码行数:24,代码来源:ServletContextTemplateLocatorTest.java
示例11: createWebDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static WebArchive createWebDeployment() {
final WebArchive war = create(WebArchive.class, "component-test.war");
war.addPackage(MyComponent.class.getPackage());
war.addAsWebInfResource(INSTANCE, "beans.xml");
war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
return war;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:9,代码来源:ComponentTestCase.java
示例12: createWebDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static WebArchive createWebDeployment() {
final WebArchive war = create(WebArchive.class, "news-test.war");
war.addPackage(Param.class.getPackage());
war.addAsWebInfResource(INSTANCE, "beans.xml");
war.addAsWebResource(new FileAsset(new File("src/test/resources/index.html")), "index.html");
war.addAsWebResource(new FileAsset(new File("src/test/resources/form.html")), "form.html");
war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
return war;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:11,代码来源:NewsTestCase.java
示例13: createEJBDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive createEJBDeployment() {
final EnterpriseArchive ear = create(EnterpriseArchive.class, "remoting-remote-naming-test.ear");
final JavaArchive jar = create(JavaArchive.class, "remoting-remote-naming-test.jar");
jar.addPackage(Machine.class.getPackage());
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/ejb-jar-remoting.xml")),
"ejb-jar.xml");
ear.addAsModule(jar);
return ear;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:11,代码来源:RemotingNamingTestCase.java
示例14: createEJBDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static JavaArchive createEJBDeployment() {
final JavaArchive jar = create(JavaArchive.class, "scopes-test.jar");
jar.addPackage(MyPosts.class.getPackage());
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/persistence-test.xml")),
"persistence.xml");
return jar;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:9,代码来源:ScopesTestCase.java
示例15: createEJBDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static JavaArchive createEJBDeployment() {
final JavaArchive jar = create(JavaArchive.class, "exception-test.jar");
jar.addPackage(RequiredException.class.getPackage());
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/persistence-test.xml")),
"persistence.xml");
return jar;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:9,代码来源:ExceptionTestCase.java
示例16: createWebDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static WebArchive createWebDeployment() {
final WebArchive war = create(WebArchive.class, "checkpointjob-test.war");
war.addPackage(PayrollCheckpoint.class.getPackage());
war.addPackage(SkippedException.class.getPackage());
war.addPackage(PayrollListener.class.getPackage());
war.addAsWebInfResource(INSTANCE, "beans.xml");
war.addAsWebInfResource(new FileAsset(new File("src/main/resources/META-INF/batch-jobs/" + JOB_NAME + ".xml")),
"classes/META-INF/batch-jobs/" + JOB_NAME + ".xml");
return war;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:12,代码来源:CheckpointJobTestCase.java
示例17: createWebDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static WebArchive createWebDeployment() {
final WebArchive war = create(WebArchive.class, "simplejob-test.war");
war.addPackage(Payroll.class.getPackage());
war.addPackage(PayrollItemProcessor.class.getPackage());
war.addAsWebInfResource(INSTANCE, "beans.xml");
war.addAsWebInfResource(
new FileAsset(new File("src/main/resources/META-INF/batch-jobs/" + JOB_NAME + ".xml")),
"classes/META-INF/batch-jobs/" + JOB_NAME + ".xml");
return war;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:12,代码来源:SimpleJobTestCase.java
示例18: createWebDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static WebArchive createWebDeployment() {
final WebArchive war = create(WebArchive.class, "mailjob-test.war");
File[] files = resolver().loadPomFromFile("pom.xml").importRuntimeDependencies()
.resolve("org.subethamail:subethasmtp:3.1.7").withTransitivity().asFile();
war.addPackage(MailBatchlet.class.getPackage());
war.addAsWebInfResource(INSTANCE, "beans.xml");
war.addAsWebInfResource(new FileAsset(new File("src/main/resources/META-INF/batch-jobs/" + JOB_NAME + ".xml")),
"classes/META-INF/batch-jobs/" + JOB_NAME + ".xml");
war.addAsLibraries(files);
return war;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:13,代码来源:MailJobTestCase.java
示例19: createEJBDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static JavaArchive createEJBDeployment() {
final JavaArchive jar = create(JavaArchive.class, "remoting-message.jar");
jar.addAsResource(new FileAsset(new File("src/test/resources/application-users.properties")),
"users.properties");
jar.addAsResource(new FileAsset(new File("src/test/resources/application-roles.properties")),
"roles.properties");
jar.addAsManifestResource(INSTANCE, "beans.xml");
return jar;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:11,代码来源:RemoteTestCase.java
示例20: createJavaDeployment
import org.jboss.shrinkwrap.api.asset.FileAsset; //导入依赖的package包/类
@Deployment
public static JavaArchive createJavaDeployment() {
final JavaArchive jar = create(JavaArchive.class, "readuncommitted-test.jar");
jar.addPackage(MyCallableTask.class.getPackage());
jar.addClass(Account.class);
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/isolations/readuncommitted-test.xml")),
"persistence.xml");
jar.addAsResource(new FileAsset(new File("src/test/resources/store.import.sql")), "store.import.sql");
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/MANIFEST.MF")), "MANIFEST.MF");
jar.addAsManifestResource(INSTANCE, "beans.xml");
return jar;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:13,代码来源:ReadUncommittedTestCase.java
注:本文中的org.jboss.shrinkwrap.api.asset.FileAsset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论