0

I'm making a program that exports the contents of my repository (or specific directory / files of my repo) into a directory on a specified server. I have the basic function working but the problem is the speed. My average tests for these exports are taking 193 seconds for all the files while running the command myself in a linux shell only takes about 6 seconds tops. Is there anything wrong with the way I am approaching this?

private boolean stageItems(SVNRepository repository, SVNUpdateClient 
                           updateClient, String server,
                           String version, ObservableList<String> items) throws SVNException {

    boolean success = false;
    long totalDuration = 0;
    String baseUrlPath = "http://" + repository.getLocation().getHost() + repository.getLocation().getPath()
            + "/branches/versions/" + version;

    Iterator<String> itemItr = items.iterator();
    while (itemItr.hasNext()) {
        long startTime = System.nanoTime() / 1000000;
        String item = itemItr.next();

        String fullPath = baseUrlPath + "/" + item;
        SVNURL url = SVNURL.parseURIEncoded(fullPath);

        SVNNodeKind nodeKind = repository.checkPath("/branches/versions/" + version + "/" + item, -1);

        File destPath = new File("\\\\" + server + "\\u1\\pyle\\team\\moy\\bbjstaging\\" + item);

        if (nodeKind == SVNNodeKind.DIR) {
            long l = updateClient.doExport(url, destPath, SVNRevision.HEAD,
                    SVNRevision.HEAD, null, true, SVNDepth.INFINITY);
        } else {
            long l = updateClient.doExport(url, destPath, SVNRevision.HEAD,
                    SVNRevision.HEAD, null, true, SVNDepth.EMPTY);
        }

    }
    return success;
}
  • Are you exporting to the same location when doing it from the shell? – alroc Mar 23 '18 at 03:23
  • Yes, both tests were exporting to the same directory. I've decided to just make a bash script and have a java class setup a connection and call my script but now I've run into another issue where specifying a server with the export command does not work as intended. Example. – Ryan Moyer Mar 23 '18 at 14:17
  • Example: svn export --username $user --password $pword --non-interactive --force http:svnurl target_server:target_path the output that the export runs successfully shows in the shell but the files never actually appear at the target location. – Ryan Moyer Mar 23 '18 at 14:19

0 Answers0