use of org.tmatesoft.svn.core.io.SVNRepository in project intellij-community by JetBrains.
the class SvnProtocolsTest method testBrowseRepositoryImpl.
private void testBrowseRepositoryImpl(final String url) throws SVNException {
final List<SVNDirEntry> list = new ArrayList<>();
final SVNRepository repository = myVcs.getSvnKitManager().createRepository(url);
repository.getDir(".", -1, null, dirEntry -> list.add(dirEntry));
Assert.assertTrue(!list.isEmpty());
}
use of org.tmatesoft.svn.core.io.SVNRepository in project intellij-community by JetBrains.
the class SvnNativeClientAuthTest method testBrowseRepositoryImpl.
private void testBrowseRepositoryImpl(final String url) throws SVNException {
final List<SVNDirEntry> list = new ArrayList<>();
final SVNRepository repository = myVcs.getSvnKitManager().createRepository(url);
repository.getDir(".", -1, null, dirEntry -> list.add(dirEntry));
Assert.assertTrue(!list.isEmpty());
}
use of org.tmatesoft.svn.core.io.SVNRepository in project oxTrust by GluuFederation.
the class SubversionService method checkRootSvnPath.
private boolean checkRootSvnPath(SVNClientManager clientManager, SVNURL repositoryURL) throws SVNException {
SVNRepository repository = SvnHelper.getSVNRepository(clientManager, repositoryURL);
// Check if root path exist
log.debug("Checking if root path exist");
SVNNodeKind nodeKind = SvnHelper.exist(repository, "");
if (nodeKind != SVNNodeKind.DIR) {
log.error("Failed to commit files to repository. Please check SVN URL gluuAppliance.properties");
return false;
}
return true;
}
use of org.tmatesoft.svn.core.io.SVNRepository in project Gargoyle by callakrsos.
the class SVNList method list.
/********************************
* 작성일 : 2016. 5. 4. 작성자 : KYJ
*
* path에 속하는 구성정보 조회
*
* @param path
* @param revision
* @param exceptionHandler
* @return
********************************/
public List<String> list(String path, String revision, Consumer<Exception> exceptionHandler) {
List<String> resultList = Collections.emptyList();
try {
SVNProperties fileProperties = new SVNProperties();
SVNRepository repository = getRepository();
Collection<SVNDirEntry> dir = repository.getDir(path, Long.parseLong(revision), fileProperties, new ArrayList<>());
resultList = dir.stream().map(d -> {
SVNNodeKind kind = d.getKind();
if (SVNNodeKind.DIR == kind) {
return d.getRelativePath().concat("/");
} else {
return d.getRelativePath();
}
}).collect(Collectors.toList());
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
if (exceptionHandler != null)
exceptionHandler.accept(e);
}
return resultList;
}
use of org.tmatesoft.svn.core.io.SVNRepository in project Gargoyle by callakrsos.
the class SVNList method listEntry.
/********************************
* 작성일 : 2016. 5. 9. 작성자 : KYJ
*
* 메타정보를 포함하는 SVN 엔트리 반환
*
* 2016-11-03 버그 수정
*
* @param path
* @param revision
* @param exceptionHandler
* @return
********************************/
public List<SVNDirEntry> listEntry(String path, String revision, boolean isRecursive, Consumer<Exception> exceptionHandler) {
List<SVNDirEntry> resultList = new LinkedList<>();
try {
SVNRepository repository = getRepository();
long parseLong = Long.parseLong(revision, 10);
List<SVNDirEntry> list = new ArrayList<>();
String _path = path;
try {
_path = URLDecoder.decode(_path, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
repository.getDir(_path, parseLong, true, list);
if (isRecursive) {
Iterator<SVNDirEntry> iterator = list.iterator();
while (iterator.hasNext()) {
SVNDirEntry entry = iterator.next();
if (entry.getKind() == SVNNodeKind.DIR) {
SVNURL url = entry.getURL();
List<SVNDirEntry> listEntry = listEntry(url.getPath(), revision, isRecursive, exceptionHandler);
resultList.addAll(listEntry);
} else {
resultList.add(entry);
}
}
} else {
resultList.addAll(list);
}
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
if (exceptionHandler != null)
exceptionHandler.accept(e);
}
return resultList;
}
Aggregations