| 1 |
|
package com.atlassian.core.spool; |
| 2 |
|
|
| 3 |
|
import java.io.InputStream; |
| 4 |
|
import java.io.IOException; |
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
|
|
|
| 85.7% |
Uncovered Elements: 2 (14) |
Complexity: 6 |
Complexity Density: 0.86 |
|
| 11 |
|
public class SmartSpool implements ThresholdingSpool |
| 12 |
|
{ |
| 13 |
|
private Spool overThresholdSpool = new BufferedFileSpool(); |
| 14 |
|
private ThresholdingSpool thresholdingSpool = new DeferredSpool(); |
| 15 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 16 |
0
|
public void setThresholdBytes(int bytes)... |
| 17 |
|
{ |
| 18 |
0
|
thresholdingSpool.setThresholdBytes(bytes); |
| 19 |
|
} |
| 20 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 21 |
2
|
public int getThresholdBytes()... |
| 22 |
|
{ |
| 23 |
2
|
return thresholdingSpool.getThresholdBytes(); |
| 24 |
|
} |
| 25 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 26 |
2
|
public InputStream spool(InputStream is) throws IOException... |
| 27 |
|
{ |
| 28 |
|
|
| 29 |
2
|
if (is.available() > getThresholdBytes()) |
| 30 |
1
|
return overThresholdSpool.spool(is); |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
1
|
return thresholdingSpool.spool(is); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
@param |
| 42 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 43 |
2
|
public void setOverThresholdSpool(Spool overThresholdSpool)... |
| 44 |
|
{ |
| 45 |
2
|
this.overThresholdSpool = overThresholdSpool; |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
@param |
| 52 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 53 |
2
|
public void setThresholdingSpool(ThresholdingSpool thresholdingSpool)... |
| 54 |
|
{ |
| 55 |
2
|
this.thresholdingSpool = thresholdingSpool; |
| 56 |
|
} |
| 57 |
|
} |