Skip to content

Commit 9219c22

Browse files
committed
fileExists() method implemented
1 parent 8137f2b commit 9219c22

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/scm4j/vcs/svn/SVNVCS.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,4 +597,17 @@ public VCSCommit getHeadCommit(String branchName) {
597597
public String toString() {
598598
return "SVNVCS [url=" + repo.getRepoUrl() + "]";
599599
}
600+
601+
@Override
602+
public Boolean fileExists(String branchName, String filePath) {
603+
try {
604+
SVNNodeKind nodeKind = repository.checkPath(
605+
new File(getBranchName(branchName), filePath).getPath().replace("\\", "/") , -1 );
606+
return nodeKind == SVNNodeKind.FILE;
607+
} catch (SVNException e) {
608+
throw new EVCSException(e);
609+
} catch (Exception e) {
610+
throw new RuntimeException(e);
611+
}
612+
}
600613
}

0 commit comments

Comments
 (0)