public SVNExternalInfo[] addExternals(SVNDirectory directory, String externals) throws SVNException {
public SVNExternalInfo[] addExternals(SVNDirectory directory, String externals) {
    public SVNExternalInfo[] addExternals(SVNDirectory directory,            String externals) throws SVNException {        if (externals == null) {            return null;        }        Collection result = new ArrayList();        SVNExternalInfo[] parsed = parseExternals(directory.getPath(),                externals);        for (int i = 0; i < parsed.length; i++) {            SVNExternalInfo info = addExternal(directory, parsed[i].getPath(),                    parsed[i].getOldURL(), parsed[i].getOldRevision());            result.add(info);        }        // get existing externals and update all that are not in result but in        // this dir.        for (Iterator exts = externals(); exts.hasNext();) {            SVNExternalInfo info = (SVNExternalInfo) exts.next();            if (!result.contains(info)                    && directory.getPath().equals(info.getOwnerPath())) {                info.setNewExternal(null, -1);            }        }        return (SVNExternalInfo[]) result.toArray(new SVNExternalInfo[result                .size()]);    }