title: cannot be cast to org.springframework.core.io.WritableResource on Spring AWS example
body: <p>I'm reading this documentation: </p>
  
  <p><a href="http://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html" rel="noreferrer">http://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html</a></p>
  
  <p>on using AWS from a Spring application. I'm particularly interested in S3, so, I set up the application and copied this snippet of code to make sure the set up is working correctly:</p>
  
  <pre><code>Resource resource = this.resourceLoader.getResource("s3://myBucket/rootFile.log");
  WritableResource writableResource = (WritableResource) resource;
  try (OutputStream outputStream = writableResource.getOutputStream()) {
    outputStream.write("test".getBytes());
  }
  </code></pre>
  
  <p>but when I run it, I get this error:</p>
  
  <pre><code>java.lang.ClassCastException: org.springframework.web.context.support.ServletContextResource cannot be cast to org.springframework.core.io.WritableResource
  </code></pre>
  
  <p>Any ideas what's wrong? is that a setup problem? It doesn't look like to me, but I'm new to this.</p>