package boa.datagen.forges.github;

import java.io.File;
import java.io.IOException;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidRemoteException;
import org.eclipse.jgit.api.errors.TransportException;


/**
 * Simple snippet which shows how to clone a repository from a remote source
 *
 * @author dominik.stadler at gmx.at
 */
public class RepositoryCloner {

	public static void clone(String[] args)
			throws IOException, InvalidRemoteException, TransportException, GitAPIException {
		// prepare a new folder for the cloned repository
		String localPath = args[1];
		String url = args[0];
		File localGitDir = new File(localPath + "/.git");
		// then clone
		Git result = null;
		try {
			result = Git.cloneRepository().setURI(url).setBare(true).setDirectory(localGitDir).call();
			// Note: the call() returns an opened repository already which needs
			// to be closed to avoid file handle leaks!
			// workaround for
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=474093
			result.getRepository().close();
		} catch (Exception e) {
		} finally {
			if (result != null && result.getRepository() != null)
				result.getRepository().close();
		}
	}

}
@@ -70,32 +70,33 @@
 io.IOException;%0A
+%0A
 import org.eclip
@@ -759,16 +759,97 @@
 = null;%0A
+%09%09%0A%09%0A%09%09java.lang.System.setProperty(%22https.protocols%22, %22TLSv1,TLSv1.1,TLSv1.2%22);%0A
 %09%09try %7B%0A
@@ -1202,16 +1202,40 @@
 on e) %7B%0A
+%09%09%09e.printStackTrace();%0A
 %09%09%7D fina

Use https protocols TLSv1,TLSv1.1,TLSv1.2