How to good code for multiple if conditions? We have to check Git and SVN folders.
    public static String getREPOType(String repoPath){
        boolean gitRepo = new File(repoPath, Constants.GIT_FOLDER).exists();
        String repoType = null;
        if(gitRepo){
            repoType = Constants.GIT;
        }else{
            boolean svnRepo = new File(repoPath, Constants.SVN_FOLDER).exists();
            if(svnRepo){
                repoType = Constants.SVN;    
            }else{
                // New type, need to be handled 
            }
        }
        return repoType;
    }

Please help if this can be refactored in Java
One trick that improves readability of if's called early return: idea is to return from method as soon as you know what will be returned.
public static String getRepoType(String repoPath) {
    boolean gitRepo = new File(repoPath, Constants.GIT_FOLDER).exists();
    if (gitRepo) {
        return Constants.GIT;
    }
    boolean svnRepo = new File(repoPath, Constants.SVN_FOLDER).exists();
    if (svnRepo) {
        return Constants.SVN;
    } 
    
    // New type, need to be handled
}

Take a look at this good question about similar stuff.