Example usage for org.eclipse.jgit.transport WalkRemoteObjectDatabase open

List of usage examples for org.eclipse.jgit.transport WalkRemoteObjectDatabase open

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport WalkRemoteObjectDatabase open.

Prototype

abstract FileStream open(String path) throws FileNotFoundException, IOException;

Source Link

Document

Open a single file for reading.

Usage

From source file:it.com.atlassian.labs.speakeasy.util.jgit.WalkFetchConnection.java

License:Eclipse Distribution License

private boolean downloadLooseObject(final AnyObjectId id, final String looseName,
        final WalkRemoteObjectDatabase remote) throws TransportException {
    try {/*w  w  w.  ja va  2s .c  o m*/
        final byte[] compressed = remote.open(looseName).toArray();
        verifyAndInsertLooseObject(id, compressed);
        return true;
    } catch (FileNotFoundException e) {
        // Not available in a loose format from this alternate?
        // Try another strategy to get the object.
        //
        recordError(id, e);
        return false;
    } catch (IOException e) {
        throw new TransportException(MessageFormat.format(JGitText.get().cannotDownload, id.name()), e);
    }
}