Example usage for org.eclipse.jgit.storage.file WindowCacheConfig MB

List of usage examples for org.eclipse.jgit.storage.file WindowCacheConfig MB

Introduction

In this page you can find the example usage for org.eclipse.jgit.storage.file WindowCacheConfig MB.

Prototype

int MB

To view the source code for org.eclipse.jgit.storage.file WindowCacheConfig MB.

Click Source Link

Document

1024 #KB (number of bytes in one mebibyte/megabyte)

Usage

From source file:jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.java

License:Apache License

private void setStreamFileThreshold() {
    int thresholdBytes = myConfig.getStreamFileThresholdMb() * WindowCacheConfig.MB;
    if (thresholdBytes <= 0) {
        //Config returns a threshold > 0, threshold in bytes can became non-positive due to integer overflow.
        //Since users set a value larger than the max possible one, most likely they wanted a threshold
        //to be large, so use maximum possible value.
        thresholdBytes = Integer.MAX_VALUE;
    }/*from   w ww.j  a v  a 2 s .c o  m*/
    GitServerUtil.configureStreamFileThreshold(thresholdBytes);
}