Collection result = new TreeSet(); for (Iterator paths = relativePaths.iterator(); paths.hasNext();) { String path = (String) paths.next(); path = "".equals(path) ? targetName : PathUtil.append( targetName, path); result.add(path); } relativePaths.clear(); relativePaths.addAll(result);
    private static File adjustRelativePaths(File rootFile,            Collection relativePaths) throws SVNException {        if (relativePaths.contains("")) {            String targetName = getTargetName(rootFile);            if (!"".equals(targetName) && rootFile.getParentFile() != null) {                rootFile = rootFile.getParentFile();            }            Collection result = new TreeSet();            for (Iterator paths = relativePaths.iterator(); paths.hasNext();) {                String path = (String) paths.next();                path = "".equals(path) ? targetName : PathUtil.append(                        targetName, path);                result.add(path);            }            relativePaths.clear();            relativePaths.addAll(result);        }        return rootFile;    }