| 1 |
|
package com.atlassian.core.spool; |
| 2 |
|
|
| 3 |
|
import java.io.File; |
| 4 |
|
import java.io.IOException; |
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
@see |
| 11 |
|
@see |
| 12 |
|
|
|
|
|
| 50% |
Uncovered Elements: 6 (12) |
Complexity: 5 |
Complexity Density: 0.71 |
|
| 13 |
|
public class DefaultSpoolFileFactory implements FileFactory |
| 14 |
|
{ |
| 15 |
|
private static final DefaultSpoolFileFactory INSTANCE = new DefaultSpoolFileFactory(); |
| 16 |
|
|
| 17 |
|
private String spoolPrefix = "spool-"; |
| 18 |
|
private String spoolSuffix = ".tmp"; |
| 19 |
|
private File spoolDirectory = null; |
| 20 |
|
|
| 21 |
|
|
| 22 |
|
@return |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 24 |
7
|
public static DefaultSpoolFileFactory getInstance()... |
| 25 |
|
{ |
| 26 |
7
|
return INSTANCE; |
| 27 |
|
} |
| 28 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 29 |
0
|
public void setSpoolPrefix(String spoolPrefix)... |
| 30 |
|
{ |
| 31 |
0
|
this.spoolPrefix = spoolPrefix; |
| 32 |
|
} |
| 33 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
0
|
public void setSpoolSuffix(String spoolSuffix)... |
| 35 |
|
{ |
| 36 |
0
|
this.spoolSuffix = spoolSuffix; |
| 37 |
|
} |
| 38 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 39 |
0
|
public void setSpoolDirectory(File spoolDirectory)... |
| 40 |
|
{ |
| 41 |
0
|
this.spoolDirectory = spoolDirectory; |
| 42 |
|
} |
| 43 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 44 |
1
|
public File createNewFile() throws IOException... |
| 45 |
|
{ |
| 46 |
1
|
File file = File.createTempFile(spoolPrefix, spoolSuffix, spoolDirectory); |
| 47 |
1
|
file.deleteOnExit(); |
| 48 |
1
|
return file; |
| 49 |
|
} |
| 50 |
|
} |