Skip to content

Commit 5c1ee49

Browse files
authored
Merge branch 'master' into gamutils_eo
2 parents f1d838f + 82ba01e commit 5c1ee49

File tree

136 files changed

+2484
-1030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+2484
-1030
lines changed

.github/workflows/Build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
servers: '[
5656
{ "id": "github-genexuslabs", "username": "genexusbot", "password": "${{ secrets.SECURE_TOKEN }}" },
5757
{ "id": "azure-devops", "username": "genexuslabs", "password": "${env.AZURE_ARTIFACTS_TOKEN}" },
58-
{ "id": "ossrh", "username": "${env.MAVEN_USERNAME}", "password": "${env.MAVEN_PASSWORD}" },
58+
{ "id": "central", "username": "${env.MAVEN_USERNAME}", "password": "${env.MAVEN_PASSWORD}" },
5959
{ "id": "gpg.passphrase", "passphrase": "${env.MAVEN_GPG_PASSPHRASE}" }
6060
]'
6161

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ These are the source of the GeneXus Standard Classes for Java, valid since GeneX
44
## Repo Status
55
| Branch | Build | Security
66
|---|---|---
7-
|master |[![](https://github.com/genexuslabs/JavaClasses/workflows/Build/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions?query=workflow%3ABuild+branch%3Amaster)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
8-
|beta |[![](https://github.com/genexuslabs/JavaClasses/workflows/Build/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions?query=workflow%3ABuild+branch%3Abeta)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
7+
|master |[![Build](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
8+
|beta |[![Build](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
99

1010
## Modules
1111

common/src/main/java/com/genexus/GXExternalCollection.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ public Vector getStruct()
9999
return struct;
100100
}
101101

102-
public ArrayList getExternalInstance() {
103-
ArrayList list = new ArrayList();
102+
@SuppressWarnings("unchecked")
103+
public <E> ArrayList<E> getExternalInstance() {
104+
ArrayList<E> list = new ArrayList<>();
104105
for (T Item : this)
105106
{
106107
try
107108
{
108-
list.add(Item.getClass().getMethod("getExternalInstance", new Class[]{}).invoke(Item));
109+
list.add((E) Item.getClass().getMethod("getExternalInstance", new Class[]{}).invoke(Item));
109110
}
110111
catch (Exception e)
111112
{
@@ -115,5 +116,23 @@ public ArrayList getExternalInstance() {
115116
return list;
116117
}
117118

119+
@SuppressWarnings("unchecked")
120+
public void setExternalInstance(ArrayList<?> data)
121+
{
122+
try {
123+
clear();
124+
for (Object item : data) {
125+
T obj = elementsType.getConstructor(new Class[]{}).newInstance();
126+
obj.getClass().getMethod("setExternalInstance", item.getClass()).invoke(obj, item);
127+
super.add(obj);
128+
vectorExternal.add(item);
129+
}
130+
}
131+
catch(Exception ex)
132+
{
133+
ex.printStackTrace();
134+
}
135+
}
136+
118137
}
119138

common/src/main/java/com/genexus/internet/GXHttpClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ protected void resetState()
483483

484484
public abstract String getString();
485485

486+
public abstract void unreadChunk();
487+
486488
public abstract String readChunk();
487489

488490
public abstract boolean getEof();

common/src/main/java/com/genexus/internet/HttpClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ public String getString()
253253
return session.getString();
254254
}
255255

256+
public void unreadChunk()
257+
{
258+
session.unreadChunk();
259+
}
260+
256261
public String readChunk()
257262
{
258263
return session.readChunk();

common/src/main/java/com/genexus/internet/HttpClientManual.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ public boolean getEof() {
436436
return true;
437437
}
438438

439+
public void unreadChunk() {
440+
}
441+
439442
public String readChunk() {
440443
return getString();
441444
}

common/src/main/java/com/genexus/internet/IHttpClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public interface IHttpClient {
4848
public void getHeader(String name, double[] value);
4949
public InputStream getInputStream() throws IOException;
5050
public String getString();
51+
public void unreadChunk();
5152
public String readChunk();
5253
public boolean getEof();
5354
public void toFile(String fileName);

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)