File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
spring-core/src/main/java/org/springframework/core/io Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,14 @@ public FileUrlResource(String location) throws MalformedURLException {
7070 }
7171
7272
73+ @ Override
74+ public Resource createRelative (String relativePath ) throws MalformedURLException {
75+ if (relativePath .startsWith ("/" )) {
76+ relativePath = relativePath .substring (1 );
77+ }
78+ return new FileUrlResource (new URL (getURL (), relativePath ));
79+ }
80+
7381 @ Override
7482 public boolean isWritable () {
7583 try {
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ public InputStream getInputStream() throws IOException {
183183 * This implementation returns the underlying URL reference.
184184 */
185185 @ Override
186- public URL getURL () throws IOException {
186+ public URL getURL () {
187187 return this .url ;
188188 }
189189
You can’t perform that action at this time.
0 commit comments