protected boolean setupUsingAppArtifact(DependenciesContainer<?> archive) throws IOException { String appArtifact = System.getProperty("wildfly.swarm.app.artifact"); if (appArtifact != null) { try (InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream("_bootstrap/" + appArtifact)) { ZipImporterImpl importer = new ZipImporterImpl(archive); importer.importFrom(in); } return true; } return false; }
public static JavaArchive artifact(String gav) throws IOException, ModuleLoadException { File file = findFile(gav); JavaArchive archive = ShrinkWrap.create(JavaArchive.class, file.getName()); new ZipImporterImpl(archive).importFrom(file); return archive; }
protected boolean setupUsingAppPath(DependenciesContainer<?> archive) throws IOException { String appPath = System.getProperty("wildfly.swarm.app.path"); if (appPath != null) { final Path path = Paths.get(System.getProperty("wildfly.swarm.app.path")); 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 { ZipImporterImpl importer = new ZipImporterImpl(archive); importer.importFrom(new File(System.getProperty("wildfly.swarm.app.path"))); } return true; } return false; }
public static JavaArchive artifact(String gav, String asName) throws IOException, ModuleLoadException { File file = findFile(gav); JavaArchive archive = ShrinkWrap.create(JavaArchive.class, asName); new ZipImporterImpl(archive).importFrom(file); return archive; }
new ZipImporterImpl(archive).importFrom(artifact); archives.add(archive); if (artifact.isFile()) { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, artifact.getName()); new ZipImporterImpl(archive).importFrom(artifact); archives.add(archive); } else {
ZipImporterImpl importer = new ZipImporterImpl(archive); importer.importFrom(in); Node jsonNode = archive.get("keycloak.json");