private void addResources(JavaArchive archive, VirtualFile basedir, VirtualFile resdir) throws IOException { String basepath = basedir.getPathName(); for (final VirtualFile child : resdir.getChildrenRecursively()) { if (child.isDirectory()) continue; String path = child.getPathName(); path = path.substring(basepath.length()); addResource(archive, path, child); } }
public DeploymentImpl(VirtualFile rootFile, String location, String symbolicName, Version version) { if (rootFile == null) throw new IllegalArgumentException("Null rootFile"); if (location == null) location = rootFile.getPathName(); if (symbolicName == null) symbolicName = rootFile.getName(); if (version == null) version = Version.emptyVersion; this.rootFile = rootFile; this.location = location; this.symbolicName = symbolicName; this.version = version.toString(); try { this.rootURL = rootFile.toURL(); } catch (IOException ex) { throw new IllegalStateException("Cannot obtain root URL", ex); } }