@Override public boolean isRecurse(VirtualFile file) { // don't recurse into /lib if (file.equals(libDir)) { return false; } for (String suffix : CHILD_ARCHIVE_EXTENSIONS) { if (file.getName().endsWith(suffix)) { // don't recurse into sub deployments return false; } } return true; } })));
/** * Get all views that have the given type in the application * * @param viewType The view type * @return All views of the given type */ public Set<ViewDescription> getComponentsForViewName(final String viewType, final VirtualFile deploymentRoot) { final List<ViewInformation> info = componentsByViewName.get(viewType); if (info == null) { return Collections.<ViewDescription>emptySet(); } final Set<ViewDescription> ret = new HashSet<ViewDescription>(); final Set<ViewDescription> currentDep = new HashSet<ViewDescription>(); for (ViewInformation i : info) { if (deploymentRoot.equals(i.deploymentRoot)) { currentDep.add(i.viewDescription); } ret.add(i.viewDescription); } if(!currentDep.isEmpty()) { return currentDep; } return ret; }
VirtualFile moduleParentFile = moduleFile.getParent(); if (moduleParentFile != null) { if (libDir.equals(moduleParentFile)) { throw EeLogger.ROOT_LOGGER.earModuleChildOfLibraryDirectory(libDirName, module.getFileName());
/** * Determine whether the given object is equal to this one. Returns true if the argument is a {@code VirtualFile} * from the same {@code VFS} instance with the same name. * * @param o the other object * @return {@code true} if they are equal */ public boolean equals(Object o) { return o instanceof VirtualFile && equals((VirtualFile) o); }
@Override public boolean equals(Object obj) { return vfsFile.equals(obj); }
private void getPathNameRelativeTo(VirtualFile parent, StringBuilder builder) { if (this.parent == null) { throw VFSMessages.MESSAGES.parentIsNotAncestor(parent); } if (this.equals(parent)) { return; } if (!this.parent.equals(parent)) { this.parent.getPathNameRelativeTo(parent, builder); builder.append('/'); } builder.append(name); }
public String getRelativePath() { if (relativePath == null) { StringBuffer sb = new StringBuffer(); for (VirtualFile f = file; f != null && !root.equals(f); f = f.getParent()) { if (sb.length() > 0) sb.insert(0, '/'); sb.insert(0, f.getName()); } relativePath = sb.toString(); } return relativePath; }
@Override public boolean isRecurse(VirtualFile file) { // don't recurse into /lib if (file.equals(libDir)) { return false; } for (String suffix : CHILD_ARCHIVE_EXTENSIONS) { if (file.getName().endsWith(suffix)) { // don't recurse into sub deployments return false; } } return true; } })));
@Override public boolean isRecurse(VirtualFile file) { // don't recurse into /lib if (file.equals(libDir)) { return false; } for (String suffix : CHILD_ARCHIVE_EXTENSIONS) { if (file.getName().endsWith(suffix)) { // don't recurse into sub deployments return false; } } return true; } })));
@Override public boolean isRecurse(VirtualFile file) { // don't recurse into /lib if (file.equals(libDir)) { return false; } for (String suffix : CHILD_ARCHIVE_EXTENSIONS) { if (file.getName().endsWith(suffix)) { // don't recurse into sub deployments return false; } } return true; } })));
/** * {@inheritDoc} */ public File getFile(VirtualFile mountPoint, VirtualFile target) { if (mountPoint.equals(target)) { return realRoot; } else if (NEEDS_CONVERSION) { return new File(realRoot, target.getPathNameRelativeTo(mountPoint).replace('/', File.separatorChar)); } else { return new File(realRoot, target.getPathNameRelativeTo(mountPoint)); } }
private static boolean isChildOf(VirtualFile other, final VirtualFile file) throws IOException { for(org.jboss.vfs.VirtualFile child : other.getChildren()) { if(child.equals(file)) return true; if(isChildOf(child, file)) return true; } return false; }
private ZipNode find(VirtualFile mountPoint, VirtualFile target) { if (mountPoint.equals(target)) { return this; } else { final ZipNode parent = find(mountPoint, target.getParent()); if (parent == null) { return null; } final Map<String, ZipNode> children = parent.children; if (children == null) { return null; } return children.get(target.getName()); } } }
/** * {@inheritDoc} */ public boolean isDirectory(VirtualFile mountPoint, VirtualFile target) { if (mountPoint.equals(target)) { return true; } final VirtualFile assemblyFile = assembly.getFile(mountPoint, target); if (assemblyFile != null) { return assemblyFile.isDirectory(); } return assembly.contains(mountPoint, target); }
/** * {@inheritDoc} */ public boolean exists(VirtualFile mountPoint, VirtualFile target) { if (mountPoint.equals(target)) { return true; } final VirtualFile assemblyFile = assembly.getFile(mountPoint, target); if (assemblyFile != null) { return assemblyFile.exists(); } return assembly.contains(mountPoint, target); }
/** * Merges information from the resource root into this resource root * * @param additionalResourceRoot The root to merge */ public void merge(final ResourceRoot additionalResourceRoot) { if(!additionalResourceRoot.getRoot().equals(root)) { throw ServerMessages.MESSAGES.cannotMergeResourceRoot(root, additionalResourceRoot.getRoot()); } usePhysicalCodeSource = additionalResourceRoot.usePhysicalCodeSource; this.exportFilters.addAll(additionalResourceRoot.getExportFilters()); } }