Example usage for org.eclipse.jgit.storage.pack PackConfig setThreads

List of usage examples for org.eclipse.jgit.storage.pack PackConfig setThreads

Introduction

In this page you can find the example usage for org.eclipse.jgit.storage.pack PackConfig setThreads.

Prototype

public void setThreads(int threads) 

Source Link

Document

Set the number of threads to use for delta compression.

Usage

From source file:net.antoniy.gidder.beta.ssh.Upload.java

License:Apache License

@Override
protected void runImpl() throws IOException {
    if (!hasPermission()) {
        err.write(MSG_REPOSITORY_PERMISSIONS.getBytes());
        err.flush();//  w  w  w  .  j a  va  2 s .co  m
        onExit(CODE_OK, MSG_REPOSITORY_PERMISSIONS);
        return;
    }

    Config config = new Config();
    //      int timeout = Integer.parseInt(config.getString("transfer", null,
    //            "timeout"));
    int timeout = 10;

    PackConfig packConfig = new PackConfig();
    packConfig.setDeltaCompress(false);
    packConfig.setThreads(1);
    packConfig.fromConfig(config);

    final UploadPack up = new UploadPack(repo);
    up.setPackConfig(packConfig);
    up.setTimeout(timeout);
    up.upload(in, out, err);
}