use of org.tmatesoft.svn.core.SVNDirEntry in project Gargoyle by callakrsos.
the class CommandTest3 method scenarioTest.
/**
*
* ################# 시나리오 테스트 ###################
*
* 1. svn 디렉토리 파일목록만 추출.
*
* 2. 추출된 파일목록에서 컨텐츠 조회
*
* @작성자 : KYJ
* @작성일 : 2016. 5. 13.
*/
@Test
public void scenarioTest() {
List<SVNDirEntry> list = testServerManager.listEntry("/sos/pass-batch-core");
Optional<String> findFirst = list.stream().filter(e -> {
SVNNodeKind kind = e.getKind();
if (SVNNodeKind.FILE == kind)
return true;
return false;
}).map(e -> {
try {
SVNURL url = e.getURL();
SVNURL repositoryRoot = e.getRepositoryRoot();
String relativeURL = SVNURLUtil.getRelativeURL(repositoryRoot, url, true);
return relativeURL;
} catch (Exception e1) {
e1.printStackTrace();
}
return "error";
}).peek(e -> {
System.out.println(testServerManager.cat(e));
}).findFirst();
// 첫번째 데이터를 찾은후...
findFirst.ifPresent(url -> {
try {
File outDir = new File("c://sampleDir");
outDir.mkdir();
System.out.println("checout dir ::: " + outDir.getAbsolutePath());
System.out.println("checout url ::: " + url);
Long checkout = testServerManager.checkout(url, outDir);
System.out.println("result ::: " + checkout);
} catch (Exception e1) {
e1.printStackTrace();
}
});
}
use of org.tmatesoft.svn.core.SVNDirEntry in project Gargoyle by callakrsos.
the class SVNListTest method recently.
@Test
public void recently() {
Properties properties = new Properties();
properties.put(JavaSVNManager.SVN_URL, "http://localhost:11121/svn/sample2/");
properties.put(JavaSVNManager.SVN_USER_ID, "kyjun.kim");
properties.put(JavaSVNManager.SVN_USER_PASS, "kyjun.kim");
JavaSVNManager manager = new JavaSVNManager(properties);
List<SVNDirEntry> listEntry = manager.listEntry("/", "-1", System.err::println);
listEntry.forEach(System.out::println);
}
Aggregations