|
2 | 2 |
|
3 | 3 | import com.genexus.GXBaseCollection; |
4 | 4 | import com.genexus.SdtMessages_Message; |
5 | | -import org.apache.logging.log4j.Logger; |
6 | 5 |
|
7 | 6 | import java.util.ArrayList; |
8 | 7 |
|
9 | 8 | public class Compression { |
10 | | - private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(Compression.class); |
11 | 9 |
|
12 | | - private String absolutePath; |
13 | | - private long maxCombinedFileSize; |
| 10 | + private String destinationPath; |
| 11 | + private CompressionConfiguration compressionConfiguration; |
14 | 12 | private GXBaseCollection<SdtMessages_Message>[] messages; |
15 | 13 | private ArrayList<String> filesToCompress; |
16 | 14 |
|
17 | 15 | public Compression() {} |
18 | 16 |
|
19 | | - public Compression(String absolutePath, long maxCombinedFileSize, GXBaseCollection<SdtMessages_Message>[] messages) { |
20 | | - this.absolutePath = absolutePath; |
21 | | - this.maxCombinedFileSize = maxCombinedFileSize; |
| 17 | + public Compression(String destinationPath, CompressionConfiguration configuration, GXBaseCollection<SdtMessages_Message>[] messages) { |
| 18 | + this.destinationPath = destinationPath; |
| 19 | + this.compressionConfiguration = configuration; |
22 | 20 | this.messages = messages; |
23 | 21 | filesToCompress = new ArrayList<>(); |
24 | 22 | } |
25 | 23 |
|
26 | | - public void setAbsolutePath(String path) { |
27 | | - this.absolutePath = path; |
| 24 | + public void setDestinationPath(String path) { |
| 25 | + this.destinationPath = path; |
28 | 26 | } |
29 | 27 |
|
30 | 28 | public void addElement(String filePath) { |
31 | 29 | filesToCompress.add(filePath); |
32 | 30 | } |
33 | 31 |
|
34 | 32 | public Boolean save() { |
35 | | - return GXCompressor.compress(filesToCompress, absolutePath, maxCombinedFileSize, messages); |
| 33 | + return GXCompressor.compress(filesToCompress, destinationPath, compressionConfiguration, messages); |
36 | 34 | } |
37 | 35 |
|
38 | 36 | public void clear() { |
39 | | - absolutePath = ""; |
| 37 | + destinationPath = ""; |
40 | 38 | filesToCompress = new ArrayList<>(); |
41 | 39 | } |
42 | 40 | } |
0 commit comments