new ExportReporterBaton(), new ExportEditor(
new ExportReporterBaton(latestRevision), new ExportEditor(
    public static void main(String[] args) {        /*         * Default values:         */        String url = "http://svn.tmate.org/svn/jsvn/branches/0.9.0/doc";        String name = "anonymous";        String password = "anonymous";        String exportDirPath = "/export";        /*         * Initializes the library (it must be done before ever using the         * library itself)         */        setupLibrary();        if (args != null) {            /*             * Obtains a repository location URL             */            url = (args.length >= 1) ? args[0] : url;            /*             * Obtains a local dir path where the repository tree             * will be exported to             */            exportDirPath = (args.length >= 2) ? args[1] : exportDirPath;            /*             * Obtains an account name (will be used to authenticate the user to             * the server)             */            name = (args.length >= 3) ? args[2] : name;            /*             * Obtains a password             */            password = (args.length >= 4) ? args[3] : password;        }        File exportDir = new File(exportDirPath);        if (exportDir.exists()) {            System.err.println("the destination directory '"                    + exportDir.getAbsolutePath() + "' already exists!");            System.exit(1);        }        exportDir.mkdirs();        SVNRepository repository = null;        try {            /*             * Creates an instance of SVNRepository to work with the repository.             * All user's requests to the repository are relative to the             * repository location used to create this SVNRepository.             * SVNURL is a wrapper for URL strings that refer to repository locations.             */            repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));        } catch (SVNException svne) {            /*             * Perhaps a malformed URL is the cause of this exception.             */            System.err                    .println("error while creating an SVNRepository for the location '"                            + url + "': " + svne.getMessage());            System.exit(1);        }        /*         * User's authentication information is provided via an ISVNAuthenticationManager         * instance. SVNWCUtil creates a default usre's authentication manager given user's         * name and password.         */        ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password);        /*         * Sets the manager of the user's authentication information that will          * be used to authenticate the user to the server (if needed) during          * operations handled by the SVNRepository.         */        repository.setAuthenticationManager(authManager);        SVNNodeKind nodeKind = null;        try {            /*             * Checks up if the current path really corresponds to a directory.             * If doesn't the program exits. SVNNodeKind is that one who says what             * is located at a path in a revision. -1 means the latest revision.             */            nodeKind = repository.checkPath("", -1);        } catch (SVNException svne) {            System.err                    .println("error while getting the node kind of the repository location dir: "                            + svne.getMessage());            System.exit(1);        }        if (nodeKind == SVNNodeKind.NONE) {            System.err.println("There is no entry at '" + url + "'.");            System.exit(1);        } else if (nodeKind == SVNNodeKind.FILE) {            System.err.println("The entry at '" + url                    + "' is a file while a directory was expected.");            System.exit(1);        }        long latestRevision = -1;        try {            /*             * Gets the latest revision number of the repository.             */            latestRevision = repository.getLatestRevision();        } catch (SVNException svne) {            System.err                    .println("error while fetching the latest repository revision: "                            + svne.getMessage());            System.exit(1);        }        try {            /*             * This call will make a simple checkout (export) of the entire directory             * "/doc" being at the latest revision from the repository to your              * exportDirPath.             *              * latestRevision is the repository revision itself we're interested in.             *              * the 2nd parameter - target - is null as we are not restricting the             * checkout scope to only this entry, we need the entire directory.             *              * the 3rd parameter - recursive - is true as we're not restricting             * the checkout scope to only entries located in "/doc" directory,             * we need the full tree.             *              * the 4th parameter is an ISVNReporterBaton who will report to the              * server that we need to checkout the "/doc" directory.             *              * the 5th parameter is an ISVNEditor who will "make" the work - create             * the local copy of "/doc".              */            repository.update(latestRevision, null, true,                    new ExportReporterBaton(), new ExportEditor(                            exportDirPath, new WorkspaceMediator()));        } catch (SVNException svne) {            System.err.println("error while exporting '" + url + "': "                    + svne.getMessage());            svne.printStackTrace();            System.exit(1);        }        System.out.println("Exported revision: " + latestRevision);        System.exit(0);    }