File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
main/java/org/springframework/core/io
test/java/org/springframework/core/io Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,12 @@ public Resource createRelative(String relativePath) {
92
92
return new ModuleResource (this .module , pathToUse );
93
93
}
94
94
95
+ @ Override
96
+ @ Nullable
97
+ public String getFilename () {
98
+ return StringUtils .getFilename (this .path );
99
+ }
100
+
95
101
@ Override
96
102
public String getDescription () {
97
103
return "module resource [" + this .path + "]" +
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ void existingResource() throws IOException {
40
40
assertThat (mr .isReadable ()).isTrue ();
41
41
assertThat (mr .isOpen ()).isFalse ();
42
42
assertThat (mr .isFile ()).isFalse ();
43
+ assertThat (mr .getFilename ()).isEqualTo ("Introspector.class" );
43
44
assertThat (mr .getDescription ()).contains (mr .getModule ().getName ());
44
45
assertThat (mr .getDescription ()).contains (mr .getPath ());
45
46
@@ -55,6 +56,7 @@ void nonExistingResource() {
55
56
assertThat (mr .isReadable ()).isFalse ();
56
57
assertThat (mr .isOpen ()).isFalse ();
57
58
assertThat (mr .isFile ()).isFalse ();
59
+ assertThat (mr .getFilename ()).isEqualTo ("Introspecter.class" );
58
60
assertThat (mr .getDescription ()).contains (mr .getModule ().getName ());
59
61
assertThat (mr .getDescription ()).contains (mr .getPath ());
60
62
You can’t perform that action at this time.
0 commit comments