Example usage for org.eclipse.jgit.transport Connection getRefsMap

List of usage examples for org.eclipse.jgit.transport Connection getRefsMap

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport Connection getRefsMap.

Prototype

Map<String, Ref> getRefsMap();

Source Link

Document

Get the complete map of refs advertised as available for fetching or pushing.

Usage

From source file:org.eclipse.egit.core.op.ListRemoteOperation.java

License:Open Source License

/**
 * @param pm//from  w w  w .  jav  a2s.co  m
 *            the monitor to be used for reporting progress and responding
 *            to cancellation. The monitor is never <code>null</code>
 * @throws InvocationTargetException
 * @throws InterruptedException
 */
public void run(IProgressMonitor pm) throws InvocationTargetException, InterruptedException {
    Transport transport = null;
    Connection connection = null;
    try {
        transport = Transport.open(localDb, uri);
        if (credentialsProvider != null)
            transport.setCredentialsProvider(credentialsProvider);
        transport.setTimeout(this.timeout);

        if (pm != null)
            pm.beginTask(CoreText.ListRemoteOperation_title, IProgressMonitor.UNKNOWN);
        connection = transport.openFetch();
        remoteRefsMap = connection.getRefsMap();
    } catch (NotSupportedException e) {
        throw new InvocationTargetException(e);
    } catch (TransportException e) {
        throw new InvocationTargetException(e);
    } finally {
        if (connection != null)
            connection.close();
        if (transport != null)
            transport.close();
        if (pm != null)
            pm.done();
    }
}