Skip to content

Commit 8bd1fd3

Browse files
committed
moved getInputStream() not-null requirement to InputStreamSource itself; removed misleading "throws IllegalStateException" declaration
Issue: SPR-9561
1 parent 5a7b3f6 commit 8bd1fd3

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

spring-core/src/main/java/org/springframework/core/io/AbstractResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public Resource createRelative(String relativePath) throws IOException {
173173
* This implementation always returns <code>null</code>,
174174
* assuming that this resource type does not have a filename.
175175
*/
176-
public String getFilename() throws IllegalStateException {
176+
public String getFilename() {
177177
return null;
178178
}
179179

spring-core/src/main/java/org/springframework/core/io/InputStreamSource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@ public interface InputStreamSource {
4747
* as JavaMail, which needs to be able to read the stream multiple times when
4848
* creating mail attachments. For such a use case, it is <i>required</i>
4949
* that each <code>getInputStream()</code> call returns a fresh stream.
50+
* @return the input stream for the underlying resource (must not be {@code null})
5051
* @throws IOException if the stream could not be opened
5152
* @see org.springframework.mail.javamail.MimeMessageHelper#addAttachment(String, InputStreamSource)
5253
*/

spring-core/src/main/java/org/springframework/core/io/Resource.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,4 @@ public interface Resource extends InputStreamSource {
133133
*/
134134
String getDescription();
135135

136-
/**
137-
* {@inheritDoc}
138-
* @return the input stream for the underlying resource (must not be {@code null}).
139-
*/
140-
public InputStream getInputStream() throws IOException;
141136
}

0 commit comments

Comments
 (0)