Skip to content

Commit 965d79e

Browse files
Sabrina Juarez GarciaBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:feature/Update_AzureStorage_SDK' into beta
1 parent e6065ed commit 965d79e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

gxcloudstorage-tests/src/test/java/com/genexus/db/driver/TestExternalProvider.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.genexus.db.driver;
22

3+
import com.genexus.GXDbFile;
34
import com.genexus.specific.java.Connect;
45
import org.junit.Assume;
56
import org.junit.Before;
@@ -28,6 +29,7 @@ public abstract class TestExternalProvider {
2829

2930
private String testSampleFileName;
3031
private String testSampleFilePath;
32+
private String testSampleSubFolderFileName;
3133
private String uniqueId;
3234

3335

@@ -58,6 +60,7 @@ public void beforeEachTestMethod() {
5860

5961
uniqueId = Integer.toString(new Random().nextInt(5000));
6062
testSampleFileName = String.format("text-%s.txt", uniqueId);
63+
testSampleSubFolderFileName = String.format("SubFolder/text-%s.txt", uniqueId);
6164
testSampleFilePath = Paths.get("resources", testSampleFileName).toString();
6265

6366
try {
@@ -78,6 +81,15 @@ public void testUploadPublicMethod(){
7881
ensureUrl(upload, ResourceAccessControlList.PublicRead);
7982
}
8083

84+
@Test
85+
public void testUploadSubFoldersPublicMethod(){
86+
String upload = provider.upload(testSampleFilePath, testSampleSubFolderFileName, ResourceAccessControlList.PublicRead);
87+
ensureUrl(upload, ResourceAccessControlList.PublicRead);
88+
String fileName = GXDbFile.getFileName(upload);
89+
Boolean fileMatch = fileName.matches("^text-\\d+$");
90+
assertTrue("Blob Name does not match",fileMatch);
91+
}
92+
8193
@Test
8294
public void testUploadDefaultMethod(){
8395
String upload = provider.upload(testSampleFilePath, testSampleFileName, ResourceAccessControlList.Default);

java/src/main/java/com/genexus/GXDbFile.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,13 @@ private static String safeDecodeUrl(String uri) {
252252
if (!hasEncodedSegments) {
253253
return uri;
254254
}
255-
String decodedPath = java.net.URLDecoder.decode(rawPath, "UTF-8");
255+
String decodedPath = URLDecoder.decode(rawPath, StandardCharsets.UTF_8.name());
256256
return new URI(
257257
u.getScheme(),
258258
u.getAuthority(),
259259
decodedPath,
260260
u.getRawQuery(),
261-
null
261+
u.getRawFragment()
262262
).toString();
263263

264264
} catch (Exception e) {

0 commit comments

Comments
 (0)