Example usage for org.eclipse.jgit.transport ReceivePack getPackSize

List of usage examples for org.eclipse.jgit.transport ReceivePack getPackSize

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport ReceivePack getPackSize.

Prototype

public long getPackSize() 

Source Link

Document

Get the size of the received pack file including the index size.

Usage

From source file:com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.java

License:Apache License

@Override
public void onPostReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
    Project.NameKey project = projectNameResolver.projectName(rp.getRepository());
    if (needPack(commands)) {
        try {//from  w  w  w  .  j av a2s . co  m
            cache.get(project).getAndAdd(rp.getPackSize());
        } catch (ExecutionException e) {
            log.warn("Couldn't process onPostReceive for " + project.get(), e);
        }
    }
}