本文整理了Java中org.jboss.shrinkwrap.api.Node.getPath()
方法的一些代码示例,展示了Node.getPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getPath()
方法的具体详情如下:
包路径:org.jboss.shrinkwrap.api.Node
类名称:Node
方法名:getPath
暂无
代码示例来源:origin: oracle/helidon
String p = n.getPath().get();
if (callback != null) {
callback.accept(p);
代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base
@Override
public boolean equals(Object obj) {
if (obj instanceof Node) {
Node node = (Node) obj;
if (path.equals(node.getPath())) {
return true;
}
}
return false;
}
代码示例来源:origin: shrinkwrap/shrinkwrap
@Override
public boolean equals(Object obj) {
if (obj instanceof Node) {
Node node = (Node) obj;
if (path.equals(node.getPath())) {
return true;
}
}
return false;
}
代码示例来源:origin: org.agiso.tempel/tempel-support-test
private ITemplateSourceEntry addJarEntry(Map<String, ITemplateSourceEntry> entries, Node jarEntry) {
String name = jarEntry.getPath().get().substring(basePathLength);
if(name.isEmpty()) {
name = "/";
}
ITemplateSourceEntry entry = new JarTemplateSourceEntry(name, jarEntry);
entries.put(name, entry);
return entry;
}
代码示例来源:origin: io.thorntail/tools
protected void filter(Set<ArchivePath> remove, Node node, ResolvedDependencies resolvedDependencies) {
String path = node.getPath().get();
if (path.startsWith("/WEB-INF/lib") && path.endsWith(".jar")) {
if (path.contains("thorntail-runner")) {
remove.add(node.getPath());
}
if (resolvedDependencies.isRemovable(node)) {
remove.add(node.getPath());
}
}
for (Node each : node.getChildren()) {
filter(remove, each, resolvedDependencies);
}
}
}
代码示例来源:origin: org.wildfly.swarm/tools
protected void filter(Set<ArchivePath> remove, Node node, ResolvedDependencies resolvedDependencies) {
String path = node.getPath().get();
if (path.startsWith("/WEB-INF/lib") && path.endsWith(".jar")) {
if (resolvedDependencies.isRemovable(node)) {
remove.add(node.getPath());
}
}
for (Node each : node.getChildren()) {
filter(remove, each, resolvedDependencies);
}
}
}
代码示例来源:origin: io.thorntail/jaxrs
private static boolean hasApplicationPathAnnotation(Archive<?> archive) {
Map<ArchivePath, Node> content = archive.getContent();
for (Map.Entry<ArchivePath, Node> entry : content.entrySet()) {
Node node = entry.getValue();
Asset asset = node.getAsset();
if (hasApplicationPathAnnotation(node.getPath(), asset)) {
return true;
}
}
return false;
}
代码示例来源:origin: io.thorntail/jaxrs
public static boolean isJAXRS(Archive<?> archive) {
Map<ArchivePath, Node> content = archive.getContent();
for (Map.Entry<ArchivePath, Node> entry : content.entrySet()) {
Node node = entry.getValue();
Asset asset = node.getAsset();
if (isJAXRS(node.getPath(), asset)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-api
private void format(StringBuilder sb, Node node) {
sb.append(node.getPath().get());
if (node.getAsset() == null) {
sb.append(FormattingConstants.SLASH);
}
sb.append(FormattingConstants.NEWLINE);
for (Node child : node.getChildren()) {
format(sb, child);
}
}
代码示例来源:origin: shrinkwrap/shrinkwrap
private void format(StringBuilder sb, Node node) {
sb.append(node.getPath().get());
if (node.getAsset() == null) {
sb.append(FormattingConstants.SLASH);
}
sb.append(FormattingConstants.NEWLINE);
for (Node child : node.getChildren()) {
format(sb, child);
}
}
代码示例来源:origin: wildfly-swarm-archive/ARCHIVE-wildfly-swarm
@Override
protected Archive<?> filter(Archive<?> archive) {
final Set<ArtifactSpec> moduleSpecs = dependencyManager.getModuleDependencies();
final Set<ArtifactSpec> nonSwarmSpecs = dependencyManager.getNonSwarmDependencies();
archive.getContent().values().stream()
.filter(node -> node.getPath().get().startsWith(WEB_INF_LIB))
.filter(node -> !nodeIsInArtifactList(node, nonSwarmSpecs, false)
&& (nodeIsInArtifactList(node, moduleSpecs, true)
|| nodeIsSwarmArtifact(node)))
.forEach(node -> archive.delete(node.getPath()));
return archive;
}
代码示例来源:origin: org.arquillian.algeron/arquillian-algeron-provider-maven-retriever
private void unpack(File destination, JavaArchive file) throws IOException {
final Node rootDir = file.get("/");
final Set<Node> contractFiles = rootDir.getChildren();
for (Node contractFile : contractFiles) {
final String filename = contractFile.getPath().get().substring(1);
final Asset asset = contractFile.getAsset();
try (final InputStream in = asset.openStream()) {
Files.copy(in, new File(destination, filename).toPath());
}
}
}
代码示例来源:origin: org.jboss.forge.test/arquillian-forge-core
@Override
public void process(Archive<?> archive)
{
if ("arquillian-core.jar".equals(archive.getName()))
{
Node node = archive.get("org/jboss/shrinkwrap/descriptor");
if (node != null)
archive.delete(node.getPath());
}
}
}
代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base
/**
* Recursive call to process all the node hierarchy
*
* @param node
*/
private void processNode(final Node node) {
processNode(node.getPath(), node);
Set<Node> children = node.getChildren();
for (Node child : children) {
processNode(child);
}
}
代码示例来源:origin: shrinkwrap/shrinkwrap
/**
* Recursive call to process all the node hierarchy
*
* @param node
*/
private void processNode(final Node node) {
processNode(node.getPath(), node);
Set<Node> children = node.getChildren();
for (Node child : children) {
processNode(child);
}
}
代码示例来源:origin: com.kumuluz.ee.testing/kumuluzee-arquillian-container
private static void copyDir(Archive<?> sourceArchive, Archive<?> targetArchive, String source, String target) {
Node sourceNode = sourceArchive.get(source);
if (sourceNode.getAsset() != null) {
targetArchive.add(sourceNode.getAsset(), target);
} else {
for (Node child : sourceNode.getChildren()) {
String childName = child.getPath().get().replaceFirst(child.getPath().getParent().get(), "");
copyDir(sourceArchive, targetArchive,
child.getPath().get(), ArchivePaths.create(target, childName).get());
}
}
}
}
代码示例来源:origin: juzu/juzu
public static WebArchive createDeployment(String packageName) throws IOException {
WebArchive war = createPortletDeployment(packageName);
Node node = war.get("WEB-INF/portlet.xml");
ArchivePath path = node.getPath();
String s = Tools.read(node.getAsset().openStream(), Tools.UTF_8);
s = s.replace("<portlet-info>", "<resource-bundle>bundle</resource-bundle>" + "<portlet-info>");
war.delete(path);
war.add(new StringAsset(s), path);
war.addAsResource(new StringAsset("abc=def"), "bundle_fr_FR.properties");
return war;
}
代码示例来源:origin: org.juzu/juzu-core
public static WebArchive createDeployment(String packageName) throws IOException {
WebArchive war = createPortletDeployment(packageName);
Node node = war.get("WEB-INF/portlet.xml");
ArchivePath path = node.getPath();
String s = Tools.read(node.getAsset().openStream(), Tools.UTF_8);
s = s.replace("<portlet-info>", "<resource-bundle>bundle</resource-bundle>" + "<portlet-info>");
war.delete(path);
war.add(new StringAsset(s), path);
war.addAsResource(new StringAsset("abc=def"), "bundle_fr_FR.properties");
return war;
}
代码示例来源:origin: org.juzu/juzu-core
public static WebArchive createDeployment(String packageName) throws IOException {
WebArchive war = createServletDeployment(true, packageName);
Node node = war.get("/WEB-INF/web.xml");
ArchivePath path = node.getPath();
String s = Tools.read(node.getAsset().openStream(), Tools.UTF_8);
s = s.replace("<async-supported>true</async-supported>",
"<init-param><param-name>juzu.resource_bundle</param-name><param-value>bundle</param-value></init-param>" +
"<async-supported>true</async-supported>");
war.delete(path);
war.add(new StringAsset(s), path);
war.addAsResource(new StringAsset("abc=def"), "bundle_fr_FR.properties");
return war;
}
代码示例来源:origin: juzu/juzu
public static WebArchive createDeployment(String packageName) throws IOException {
WebArchive war = createServletDeployment(true, packageName);
Node node = war.get("/WEB-INF/web.xml");
ArchivePath path = node.getPath();
String s = Tools.read(node.getAsset().openStream(), Tools.UTF_8);
s = s.replace("<async-supported>true</async-supported>",
"<init-param><param-name>juzu.resource_bundle</param-name><param-value>bundle</param-value></init-param>" +
"<async-supported>true</async-supported>");
war.delete(path);
war.add(new StringAsset(s), path);
war.addAsResource(new StringAsset("abc=def"), "bundle_fr_FR.properties");
return war;
}
内容来源于网络,如有侵权,请联系作者删除!