/** * Creates a new Path using the specified base and specified relative context. * * @param basePath * @param context */ public BasicPath(final ArchivePath basePath, final String context) { this(basePath.get(), context); }
/** * Creates a new Path using the specified base and specified relative context. * * @param basePath * @param context */ public BasicPath(final ArchivePath basePath, final ArchivePath context) { this(basePath, context.get()); }
/** * Creates a new Path using the specified base and specified relative context. * * @param basePath * @param context */ public BasicPath(final String basePath, final ArchivePath context) { this(basePath, context.get()); }
/** * Creates a new Path using the specified base and specified relative context. * * @param basePath * @param context */ public BasicPath(final ArchivePath basePath, final ArchivePath context) { this(basePath, context.get()); }
/** * Check to see if one path starts with another * * @param fullPath * @param startingPath * @return */ private boolean startsWith(ArchivePath fullPath, ArchivePath startingPath) { final String context = fullPath.get(); final String startingContext = startingPath.get(); return context.startsWith(startingContext); }
@Override public boolean include(ArchivePath path) { if (path.get().matches(expression)) { return false; } return true; } }
@Override public boolean include(ArchivePath path) { if (path.get().matches(expression)) { return true; } return false; } }
@Override public boolean include(ArchivePath path) { if (paths.contains(path.get())) { return true; } return false; } }
@Override public boolean include(ArchivePath path) { if (paths.contains(path.get())) { return false; } return true; } }
@Override public boolean include(ArchivePath object) { return object.get().endsWith(".jar"); } });
@Override public boolean include(ArchivePath path) { if (path.get().matches(expression)) { return false; } return true; } }
@Override public boolean include(ArchivePath path) { return path.get().endsWith(WAR_EXTENSION); } });
public String getClassName(ArchivePath path) { String className = path.get(); if(className.charAt(0) == '/') { className = className.substring(1); } className = className.replaceAll("\\.class", ""); className = className.replaceAll("/", "."); return className; } }
private void findServiceDescriptors(final Archive<?> archive, final Map<ArchivePath, List<Node>> descs) { archive.getContent(path -> path.get().startsWith("/META-INF/services/")) .forEach((path, node) -> { List<Node> nodes = descs.get(path); if (nodes == null) { nodes = new ArrayList<>(); descs.put(path, nodes); } nodes.add(node); }); }
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; }
@Override public boolean include(final ArchivePath archivePath) { if (!delegate.include(archivePath)) { return false; } if (archivePath.get().contains("shiro.ini")) { paths.put(archivePath, addArquillianServletInUrls(archivePath)); return false; } return true; }
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); } }
@Test public void getPathRoot() { final Path path = fileSystem.getPath("/"); Assert.assertEquals("Root path not obtained correctly", ArchivePaths.root().get(), path.toString()); }