moved getInputStream() not-null requirement to InputStreamSource itself; removed misleading "throws IllegalStateException" declaration

Issue: SPR-9561
master
Juergen Hoeller 12 years ago
parent 5a7b3f65ec
commit 8bd1fd3715
  1. 2
      spring-core/src/main/java/org/springframework/core/io/AbstractResource.java
  2. 3
      spring-core/src/main/java/org/springframework/core/io/InputStreamSource.java
  3. 5
      spring-core/src/main/java/org/springframework/core/io/Resource.java

@ -173,7 +173,7 @@ public abstract class AbstractResource implements Resource {
* This implementation always returns <code>null</code>,
* assuming that this resource type does not have a filename.
*/
public String getFilename() throws IllegalStateException {
public String getFilename() {
return null;
}

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

@ -133,9 +133,4 @@ public interface Resource extends InputStreamSource {
*/
String getDescription();
/**
* {@inheritDoc}
* @return the input stream for the underlying resource (must not be {@code null}).
*/
public InputStream getInputStream() throws IOException;
}

Loading…
Cancel
Save