Skip to content

Commit c26b06e

Browse files
authored
Merge branch 'master' into feature/log-improvement
2 parents 569f8a3 + 1b37ff7 commit c26b06e

File tree

7 files changed

+1308
-8
lines changed

7 files changed

+1308
-8
lines changed

gxcompress/pom.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.genexus</groupId>
8+
<artifactId>parent</artifactId>
9+
<version>${revision}${changelist}</version>
10+
</parent>
11+
12+
<artifactId>gxcompress</artifactId>
13+
<name>GeneXus compression and decompression module</name>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.apache.commons</groupId>
18+
<artifactId>commons-compress</artifactId>
19+
<version>1.27.1</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.tukaani</groupId>
23+
<artifactId>xz</artifactId>
24+
<version>1.10</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.apache.logging.log4j</groupId>
28+
<artifactId>log4j-core</artifactId>
29+
<version>${log4j.version}</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.apache.logging.log4j</groupId>
33+
<artifactId>log4j-api</artifactId>
34+
<version>${log4j.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>${project.groupId}</groupId>
38+
<artifactId>gxcommon</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>com.genexus</groupId>
43+
<artifactId>gxclassR</artifactId>
44+
<version>${project.version}</version>
45+
<scope>test</scope>
46+
</dependency>
47+
</dependencies>
48+
49+
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.genexus.compression;
2+
3+
import com.genexus.GXBaseCollection;
4+
import com.genexus.SdtMessages_Message;
5+
6+
import java.util.ArrayList;
7+
8+
public class Compression {
9+
10+
private String destinationPath;
11+
private CompressionConfiguration compressionConfiguration;
12+
private GXBaseCollection<SdtMessages_Message>[] messages;
13+
private ArrayList<String> filesToCompress;
14+
15+
public Compression() {}
16+
17+
public Compression(String destinationPath, CompressionConfiguration configuration, GXBaseCollection<SdtMessages_Message>[] messages) {
18+
this.destinationPath = destinationPath;
19+
this.compressionConfiguration = configuration;
20+
this.messages = messages;
21+
filesToCompress = new ArrayList<>();
22+
}
23+
24+
public void setDestinationPath(String path) {
25+
this.destinationPath = path;
26+
}
27+
28+
public void addElement(String filePath) {
29+
filesToCompress.add(filePath);
30+
}
31+
32+
public Boolean save() {
33+
return GXCompressor.compress(filesToCompress, destinationPath, compressionConfiguration, messages);
34+
}
35+
36+
public void clear() {
37+
destinationPath = "";
38+
filesToCompress = new ArrayList<>();
39+
messages = null;
40+
compressionConfiguration = new CompressionConfiguration();
41+
}
42+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.genexus.compression;
2+
3+
public class CompressionConfiguration {
4+
public long maxCombinedFileSize = -1;
5+
public long maxIndividualFileSize = -1;
6+
public int maxFileCount = -1;
7+
public String targetDirectory = "";
8+
9+
public CompressionConfiguration() {}
10+
}

0 commit comments

Comments
 (0)