use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project omegat by omegat-org.
the class ConvertProject26to37team method getSVNUrl.
/**
* Get repository URL for SVN.
*/
private static String getSVNUrl(File wc) throws Exception {
final SvnOperationFactory of = new SvnOperationFactory();
final SvnGetInfo infoOp = of.createGetInfo();
infoOp.setSingleTarget(SvnTarget.fromFile(wc));
infoOp.setDepth(SVNDepth.EMPTY);
infoOp.setRevision(SVNRevision.WORKING);
final SvnInfo info = infoOp.run();
SVNURL svn = info.getUrl();
return svn.toString();
}
use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project scheduling by ow2-proactive.
the class PackageDownloader method downloadPackageFromGithub.
/**
* This method downloads an entire github repository or only a sub-directory within a repository.<br>
* It can also download and extract an archive version of a github repository.
* It relies on svn export command.<br>
*
* @param githubURL
* @return
*/
private String downloadPackageFromGithub(String githubURL) throws SVNException {
// Convert the githubRL to an svn format
String svnURL = transformGithubURLToSvnURL(githubURL);
// Save files in a system temporary directory
String tDir = System.getProperty("java.io.tmpdir");
String packagePath = tDir + "pkg_tmp" + System.nanoTime();
File outputDir = new File(packagePath);
// Perform an "svn export" command to download an entire repository or a subdirectory
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
try {
final SvnExport export = svnOperationFactory.createExport();
export.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(svnURL)));
export.setSingleTarget(SvnTarget.fromFile(outputDir));
// overwrite an existing file
export.setForce(true);
export.run();
} finally {
// close connection pool associted with this object
svnOperationFactory.dispose();
}
return packagePath;
}
use of org.tmatesoft.svn.core.wc2.SvnOperationFactory in project GMM by Katharsas.
the class SVNTest method init.
// TODO when access to repository is not possible, any file uploads cannot be made and must be disabled.
// TODO when access to repository is not possible, file downloads must be disabled because the files could be outdated and the GMM woudn't know that.
public void init() throws SVNException {
final ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager("(login name)", "(login password)".toCharArray());
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
svnOperationFactory.setAuthenticationManager(authManager);
}
Aggregations