[utilities COMMIT] in /java-support/trunk/src: main/java/net/shibboleth/utilities/java/support/httpclient/HttpResourc...

noreply at shibboleth.net noreply at shibboleth.net
Thu Jan 16 07:21:33 EST 2014


Author: rdw
Date: Thu Jan 16 07:21:33 2014
New Revision: 513

URL: http://svn.shibboleth.net/view/utilities?rev=513&view=rev
Log:
IDP-308 Resource refactoring

ShibbolethResource is renamed Resource and has one method name change to allow calsses to implement both it and Spring.io.Resource.

ShibbolethResourceHelper is renamed ResourceHelper

All vestiges of Resource implementation have been removed from Java-support.

Added:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/Resource.java
      - copied, changed from r507, java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ShibbolethResource.java
Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpResource.java
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/AbstractResource.java
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ResourceException.java
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ShibbolethResource.java
    java-support/trunk/src/test/java/net/shibboleth/utilities/java/support/httpclient/HttpResourceTest.java
    java-support/trunk/src/test/java/net/shibboleth/utilities/java/support/resource/TestResourceConverter.java

Copied: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/Resource.java (from r507, java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ShibbolethResource.java)
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/Resource.java?p2=java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/Resource.java&p1=java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ShibbolethResource.java&r1=507&r2=513&rev=513&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/ShibbolethResource.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/resource/Resource.java Thu Jan 16 07:21:33 2014
@@ -32,7 +32,7 @@
  * Shibboleth components only implement this interface if they also implement the Spring Resource interface. Refer to
  * the Spring documentation to implement other versions of this in a spring free environment.
  * */
-public interface ShibbolethResource {
+public interface Resource {
 
     /**
      * Return whether this resource actually exists in physical form.
@@ -95,14 +95,17 @@
 
     /**
      * Return an {@link InputStream}.
-     * <p>It is expected that each call creates a <i>fresh</i> stream.
-     * <p>This requirement is particularly important when you consider an API such
-     * 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()} call returns a fresh stream.
+     * <p>
+     * It is expected that each call creates a <i>fresh</i> stream.
+     * <p>
+     * This requirement is particularly important when you consider an API such 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()} 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)
+     * @see org.springframework.mail.javamail.MimeMessageHelper#addAttachment(String,
+     *      org.springframework.core.io.InputStreamSource)
      */
     @Nonnull InputStream getInputStream() throws IOException;
 
@@ -131,7 +134,7 @@
      * @return the resource handle for the relative resource
      * @throws IOException if the relative resource cannot be determined
      */
-    ShibbolethResource createRelative(String relativePath) throws IOException;
+    Resource createRelativeResource(String relativePath) throws IOException;
 
     /**
      * Determine a filename for this resource, i.e. typically the last part of the path: for example, "myfile.txt".

Modified: java-support/trunk/src/test/java/net/shibboleth/utilities/java/support/resource/TestResourceConverter.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/test/java/net/shibboleth/utilities/java/support/resource/TestResourceConverter.java?rev=513&r1=512&r2=513&view=diff
==============================================================================
--- java-support/trunk/src/test/java/net/shibboleth/utilities/java/support/resource/TestResourceConverter.java (original)
+++ java-support/trunk/src/test/java/net/shibboleth/utilities/java/support/resource/TestResourceConverter.java Thu Jan 16 07:21:33 2014
@@ -30,9 +30,9 @@

[... 111 lines stripped ...]


More information about the commits mailing list