All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.jarch.svn.ListSvn Maven / Gradle / Ivy

There is a newer version: 24.8.0
Show newest version
package br.com.jarch.svn;

import org.tmatesoft.svn.core.ISVNDirEntryHandler;
import org.tmatesoft.svn.core.SVNDirEntry;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.SVNRevision;

import java.net.URL;
import java.util.ArrayList;
import java.util.List;

class ListSvn extends BaseSvn {

    private static final long serialVersionUID = 1753734117156570817L;

    public ListSvn(List log, String login, String senha) {
        super(log, login, senha);
    }

    public List list(final URL url) throws Exception {
        final List lista = new ArrayList<>();
        getLogClient().doList(SVNURL.parseURIEncoded(url.toString()), SVNRevision.HEAD, SVNRevision.HEAD, false, false, new ISVNDirEntryHandler() {
            public void handleDirEntry(SVNDirEntry entry) {
                String pasta = entry.getURL().toString().replace(url.toString(), "");
                if (!pasta.startsWith("http") && !pasta.startsWith("_")) {
                    lista.add(pasta);
                }
            }
        });

        return lista;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy