Class GridFsStoreResource

java.lang.Object
internal.org.springframework.content.mongo.io.GridFsStoreResource
All Implemented Interfaces:
DeletableResource, org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource, org.springframework.core.io.WritableResource

public class GridFsStoreResource extends Object implements org.springframework.core.io.Resource, org.springframework.core.io.WritableResource, DeletableResource
  • Constructor Details

    • GridFsStoreResource

      public GridFsStoreResource(org.springframework.core.io.Resource delegate, org.springframework.data.mongodb.gridfs.GridFsTemplate gridfs)
    • GridFsStoreResource

      public GridFsStoreResource(String location, org.springframework.data.mongodb.gridfs.GridFsTemplate gridfs)
  • Method Details

    • contentLength

      public long contentLength() throws IOException
      Specified by:
      contentLength in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getFilename

      public String getFilename() throws IllegalStateException
      Specified by:
      getFilename in interface org.springframework.core.io.Resource
      Throws:
      IllegalStateException
    • lastModified

      public long lastModified() throws IOException
      Specified by:
      lastModified in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getId

      public Object getId()
    • exists

      public boolean exists()
      Specified by:
      exists in interface org.springframework.core.io.Resource
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface org.springframework.core.io.Resource
    • getInputStream

      public InputStream getInputStream() throws IOException, IllegalStateException
      Specified by:
      getInputStream in interface org.springframework.core.io.InputStreamSource
      Throws:
      IOException
      IllegalStateException
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.springframework.core.io.Resource
    • isReadable

      public boolean isReadable()
      Specified by:
      isReadable in interface org.springframework.core.io.Resource
    • getURL

      public URL getURL() throws IOException
      Specified by:
      getURL in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getURI

      public URI getURI() throws IOException
      Specified by:
      getURI in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getFile

      public File getFile() throws IOException
      Specified by:
      getFile in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • createRelative

      public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException
      Specified by:
      createRelative in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isWritable

      public boolean isWritable()
      Specified by:
      isWritable in interface org.springframework.core.io.WritableResource
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Specified by:
      getOutputStream in interface org.springframework.core.io.WritableResource
      Throws:
      IOException
    • delete

      public void delete()
      Specified by:
      delete in interface DeletableResource