Skip to content

Commit e15f606

Browse files
authored
#HouseKeeping: CloudStorage implementation refactoring. Prepare for import using gradle (#649)
* Refactor and Move Cloud Storage implementation * Rename pipline file and called module name * Try clean Google Cloud unnecessary maven dependencies * Reduce Google Dependencie Tyree * Try reduce Google Cloud dependencies * Reduce file differences * Bump AWS SDK version * Rename project * Try Skip maven module CloudStorageTests * Azure Blob Storage bump * Add maven plugin version * Azure back to SDK v11
1 parent d97dead commit e15f606

File tree

30 files changed

+322
-132
lines changed

30 files changed

+322
-132
lines changed

.github/workflows/External-Storage-Tests.yml renamed to .github/workflows/cloud-storage-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: External Storage Tests
1+
name: Cloud Storage Tests
22

33
on:
44
workflow_dispatch:
@@ -16,8 +16,8 @@ on:
1616
- cron: '0 0 * * 1' # At 00:00 on (every) Monday
1717

1818
jobs:
19-
test-external-storages:
20-
name: Test External Storage
19+
test-cloud-storage-providers:
20+
name: Cloud Storage Provider Test
2121
env:
2222
GIT_REF: ${{ github.ref }}
2323
GIT_SHA: ${{ github.sha }}
@@ -45,7 +45,7 @@ jobs:
4545
- name: Install
4646
run: mvn -B install --file $POM_PATH
4747

48-
- name: Test External Storages
48+
- name: Test Cloud Storage
4949
run: |
5050
export AWSS3_TEST_ENABLED=true
5151
export STORAGE_AWSS3_ACCESS_KEY="${{ secrets.AWSS3_ACCESS_KEY }}"
@@ -72,4 +72,4 @@ jobs:
7272
export STORAGE_GOOGLECS_FOLDER_NAME=gxclasses
7373
export STORAGE_GOOGLECS_APPLICATION_NAME=gxjavacloudstorageunittests
7474
75-
mvn -B -pl gxexternalproviders test --file $POM_PATH
75+
mvn -B -pl gxcloudstorage-tests test --file $POM_PATH
File renamed without changes.

gxcloudstorage-awss3/pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
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+
7+
<parent>
8+
<groupId>com.genexus</groupId>
9+
<artifactId>parent</artifactId>
10+
<version>${revision}${changelist}</version>
11+
</parent>
12+
13+
<artifactId>gxcloudstorage-awss3</artifactId>
14+
<name>GeneXus AWS S3 Cloud Storage</name>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>${project.groupId}</groupId>
19+
<artifactId>gxclassR</artifactId>
20+
<version>${project.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>com.genexus</groupId>
24+
<artifactId>gxcloudstorage-common</artifactId>
25+
<version>${project.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>com.amazonaws</groupId>
29+
<artifactId>aws-java-sdk-s3</artifactId>
30+
<version>${com.amazonaws.version}</version>
31+
</dependency>
32+
</dependencies>
33+
</project>
File renamed without changes.

gxcloudstorage-azureblob/pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
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+
7+
<parent>
8+
<groupId>com.genexus</groupId>
9+
<artifactId>parent</artifactId>
10+
<version>${revision}${changelist}</version>
11+
</parent>
12+
13+
<artifactId>gxcloudstorage-azureblob</artifactId>
14+
<name>GeneXus Azure Blob Cloud Storage</name>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>${project.groupId}</groupId>
19+
<artifactId>gxclassR</artifactId>
20+
<version>${project.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>com.genexus</groupId>
24+
<artifactId>gxcloudstorage-common</artifactId>
25+
<version>${project.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>com.microsoft.azure</groupId>
29+
<artifactId>azure-storage</artifactId>
30+
<version>8.6.6</version>
31+
</dependency>
32+
</dependencies>
33+
</project>

gxexternalproviders/src/main/java/com/genexus/db/driver/ExternalProviderAzureStorage.java renamed to gxcloudstorage-azureblob/src/main/java/com/genexus/db/driver/ExternalProviderAzureStorage.java

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
package com.genexus.db.driver;
22

33
import com.genexus.Application;
4+
import com.genexus.StructSdtMessages_Message;
45
import com.genexus.util.GXService;
56
import com.genexus.util.StorageUtils;
6-
import com.genexus.StructSdtMessages_Message;
7-
8-
import com.microsoft.azure.storage.*;
7+
import com.microsoft.azure.storage.CloudStorageAccount;
8+
import com.microsoft.azure.storage.StorageException;
99
import com.microsoft.azure.storage.blob.*;
10+
import org.apache.logging.log4j.LogManager;
11+
import org.apache.logging.log4j.Logger;
1012

11-
import java.io.InputStream;
1213
import java.io.ByteArrayInputStream;
1314
import java.io.IOException;
15+
import java.io.InputStream;
1416
import java.net.URISyntaxException;
1517
import java.security.InvalidKeyException;
16-
import java.util.ArrayList;
17-
import java.util.Calendar;
18-
import java.util.Date;
19-
import java.util.HashMap;
20-
import java.util.List;
21-
22-
import org.apache.logging.log4j.LogManager;
23-
import org.apache.logging.log4j.Logger;
18+
import java.util.*;
2419

2520
public class ExternalProviderAzureStorage extends ExternalProviderBase implements ExternalProvider {
2621
private static Logger logger = LogManager.getLogger(ExternalProviderAzureStorage.class);
@@ -111,7 +106,7 @@ public void download(String externalFileName, String localFile, ResourceAccessCo
111106
logger.error("Invalid URI ", ex.getMessage());
112107
} catch (StorageException ex) {
113108
throw new RuntimeException(ex.getMessage(), ex);
114-
} catch (java.io.IOException ioex) {
109+
} catch (IOException ioex) {
115110
logger.error("Error downloading file", ioex);
116111
}
117112
}
@@ -168,7 +163,7 @@ public String upload(String externalFileName, InputStream input, ResourceAccessC
168163
return "";
169164
} catch (StorageException ex) {
170165
throw new RuntimeException(ex.getMessage(), ex);
171-
} catch (java.io.IOException ex) {
166+
} catch (IOException ex) {
172167
logger.error("Error uploading file", ex);
173168
return "";
174169
}
@@ -359,7 +354,7 @@ public void createDirectory(String directoryName) {
359354
logger.error("Invalid URI ", ex.getMessage());
360355
} catch (StorageException ex) {
361356
throw new RuntimeException(ex.getMessage(), ex);
362-
} catch (java.io.IOException ioex) {
357+
} catch (IOException ioex) {
363358
logger.error("Error uploading file", ioex);
364359
}
365360
}
File renamed without changes.

gxcloudstorage-common/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
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+
7+
<parent>
8+
<groupId>com.genexus</groupId>
9+
<artifactId>parent</artifactId>
10+
<version>${revision}${changelist}</version>
11+
</parent>
12+
13+
<artifactId>gxcloudstorage-common</artifactId>
14+
<name>GeneXus Cloud Storage Common</name>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>${project.groupId}</groupId>
19+
<artifactId>gxclassR</artifactId>
20+
<version>${project.version}</version>
21+
</dependency>
22+
</dependencies>
23+
24+
</project>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)