@@ -104,9 +104,6 @@ public class ITestAzureBlobFileSystemCreate extends
104
104
private static final Path TEST_FILE_PATH = new Path ("testfile" );
105
105
private static final String TEST_FOLDER_PATH = "testFolder" ;
106
106
private static final String TEST_CHILD_FILE = "childFile" ;
107
- private static final String PATH_CONFLICT
108
- = "The specified path, or an element of the path, exists and its resource type is invalid for this operation." ;
109
- private static final String BLOB_EXIST = "already exists" ;
110
107
111
108
public ITestAzureBlobFileSystemCreate () throws Exception {
112
109
super ();
@@ -1008,7 +1005,6 @@ public void testCreationWithoutConditionalOverwrite()
1008
1005
config )) {
1009
1006
fs .mkdirs (new Path ("a/b/c" ));
1010
1007
intercept (IOException .class ,
1011
- PATH_CONFLICT ,
1012
1008
() -> fs .create (new Path ("a/b/c" ), true ));
1013
1009
}
1014
1010
}
@@ -1026,11 +1022,13 @@ public void testCreationWithoutConditionalOverwrite()
1026
1022
public void testCreationOverwriteFalseWithoutConditionalOverwrite () throws Exception {
1027
1023
try (AzureBlobFileSystem currentFs = getFileSystem ()) {
1028
1024
Configuration config = new Configuration (this .getRawConfiguration ());
1029
- config .set ("fs.azure.enable.conditional.create.overwrite" , String .valueOf (false ));
1025
+ config .set ("fs.azure.enable.conditional.create.overwrite" ,
1026
+ String .valueOf (false ));
1030
1027
1031
- try (AzureBlobFileSystem fs = (AzureBlobFileSystem ) FileSystem .newInstance (currentFs .getUri (), config )) {
1028
+ try (AzureBlobFileSystem fs = (AzureBlobFileSystem ) FileSystem .newInstance (
1029
+ currentFs .getUri (), config )) {
1032
1030
fs .mkdirs (new Path ("a/b/c" ));
1033
- intercept (IOException .class , BLOB_EXIST ,
1031
+ intercept (IOException .class ,
1034
1032
() -> fs .create (new Path ("a/b/c" ), false ));
1035
1033
}
1036
1034
}
@@ -1047,7 +1045,7 @@ public void testCreateSameFileWithOverwriteFalse() throws Exception {
1047
1045
Assertions .assertThat (fs .exists (new Path ("a/b/c" )))
1048
1046
.describedAs ("Path does not exist" )
1049
1047
.isTrue ();
1050
- intercept (IOException .class , BLOB_EXIST ,
1048
+ intercept (IOException .class ,
1051
1049
() -> fs .create (new Path ("a/b/c" ), false ));
1052
1050
}
1053
1051
}
@@ -1064,7 +1062,6 @@ public void testCreateSubPath() throws Exception {
1064
1062
.describedAs ("Path does not exist" )
1065
1063
.isTrue ();
1066
1064
intercept (IOException .class ,
1067
- PATH_CONFLICT ,
1068
1065
() -> fs .create (new Path ("a/b" )));
1069
1066
}
1070
1067
}
@@ -1222,9 +1219,9 @@ public void testParentExplicitPathImplicit() throws Exception {
1222
1219
Path sourcePath = new Path (sourcePathName );
1223
1220
createAzCopyFolder (sourcePath );
1224
1221
1225
- intercept (IOException .class , PATH_CONFLICT , () ->
1222
+ intercept (IOException .class , () ->
1226
1223
fs .create (sourcePath , true ));
1227
- intercept (IOException .class , PATH_CONFLICT , () ->
1224
+ intercept (IOException .class , () ->
1228
1225
fs .create (sourcePath , false ));
1229
1226
1230
1227
Assertions .assertThat (
@@ -1374,7 +1371,7 @@ public void testCreateFileParentFile() throws Exception {
1374
1371
1375
1372
String childName = "/testParentFile/testChildFile" ;
1376
1373
Path child = new Path (childName );
1377
- IOException e = intercept (IOException .class , PATH_CONFLICT , () ->
1374
+ IOException e = intercept (IOException .class , () ->
1378
1375
fs .create (child , false ));
1379
1376
1380
1377
// asserting that parent stays explicit
@@ -1396,8 +1393,7 @@ public void testCreateMkdirs() throws Exception {
1396
1393
try (AzureBlobFileSystem fs = getFileSystem ()) {
1397
1394
fs .create (new Path ("a/b/c" ));
1398
1395
intercept (IOException .class ,
1399
- "The specified path, or an element of the path, exists and its resource type is invalid for this operation." ,
1400
- () -> fs .mkdirs (new Path ("a/b/c/d" )));
1396
+ () -> fs .mkdirs (new Path ("a/b/c/d" )));
1401
1397
}
1402
1398
}
1403
1399
@@ -1554,7 +1550,7 @@ public void testFileCreateMkdirsRoot() throws Exception {
1554
1550
fs .setWorkingDirectory (new Path ("/" ));
1555
1551
final Path p1 = new Path ("dir1" );
1556
1552
fs .create (p1 );
1557
- intercept (IOException .class , PATH_CONFLICT ,
1553
+ intercept (IOException .class ,
1558
1554
() -> fs .mkdirs (new Path ("dir1/dir2" )));
1559
1555
}
1560
1556
}
@@ -1568,7 +1564,7 @@ public void testFileCreateMkdirsNonRoot() throws Exception {
1568
1564
try (AzureBlobFileSystem fs = getFileSystem ()) {
1569
1565
final Path p1 = new Path ("dir1" );
1570
1566
fs .create (p1 );
1571
- intercept (IOException .class , PATH_CONFLICT , () -> fs .mkdirs (new Path ("dir1/dir2" )));
1567
+ intercept (IOException .class , () -> fs .mkdirs (new Path ("dir1/dir2" )));
1572
1568
}
1573
1569
}
1574
1570
@@ -1753,7 +1749,8 @@ public void testCreateDirectoryAndFileRecreation() throws Exception {
1753
1749
Assertions .assertThat (fs .exists (new Path ("a/b/c/d" )))
1754
1750
.describedAs ("File a/b/c/d does not exist" )
1755
1751
.isTrue ();
1756
- intercept (IOException .class , PATH_CONFLICT , () -> fs .mkdirs (new Path ("a/b/c/d" )));
1752
+ intercept (IOException .class ,
1753
+ () -> fs .mkdirs (new Path ("a/b/c/d" )));
1757
1754
}
1758
1755
}
1759
1756
0 commit comments