br.com.jarch.svn.ListSvn Maven / Gradle / Ivy
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;
}
}