/** * Get the corresponding relative path for a file. * Handles jars specially. */ protected static String convertPathToRelative(File file) { String ret; if(file instanceof JarAsDirectory) { JarAsDirectory jar = (JarAsDirectory)file; if(jar.getZipEntry()!=null) ret = jar.getZipEntry().getName(); else ret = SUtil.convertPathToRelative(jar.getJarPath()); } else { ret = file!=null ? SUtil.convertPathToRelative(file.getAbsolutePath()): null; } return ret; }
/** * Get the path entries {path, display name}. */ public String[] getPathEntries() { String[] ret = new String[getChildCount()]; for(int i=0; i<ret.length; i++) { ISwingTreeNode node = getChild(i); if(node instanceof FileNode) { if(node instanceof JarNode) { ret[i] = ((JarAsDirectory)((FileNode)node).getFile()).getJarPath(); } else { ret[i] = ((FileNode)node).getFile().getAbsolutePath(); } } else { // Todo: if(node instanceof RemoteJarNode)??? ret[i] = ((RemoteFileNode)node).getRemoteFile().getPath(); } } return ret; } }
ename = ename.substring(slash!=-1? slash+1: 0, ename.endsWith("/")? ename.length()-1: ename.length()); final RemoteJarFile tmp = new RemoteJarFile(ename, "jar:file:"+jad.getJarPath()+"!/"+entry.getName(), entry.isDirectory(), ename, rjfentries, entry.getName(), entry.getTime(), File.separatorChar, SUtil.getPrefixLength(jad), jad.length());
final RemoteJarFile tmp = new RemoteJarFile(ename, jad.getJarPath(), entry.isDirectory(), ename, null, entry.getName(), entry.getTime(), File.separatorChar, SUtil.getPrefixLength(jad), jad.length());