Class OracleStorageResource

java.lang.Object
org.springframework.core.io.AbstractResource
com.oracle.cloud.spring.storage.OracleStorageResource
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource, org.springframework.core.io.WritableResource

public class OracleStorageResource extends org.springframework.core.io.AbstractResource implements org.springframework.core.io.WritableResource
Default OCI Storage resource implementation of Spring Resource.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OracleStorageResource(StorageLocation location, com.oracle.bmc.objectstorage.ObjectStorageClient osClient)
     
    OracleStorageResource(String bucketName, String objectName, com.oracle.bmc.objectstorage.ObjectStorageClient osClient)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(String location, com.oracle.bmc.objectstorage.ObjectStorageClient osClient)
    Creates new OracleStorageResource identified by location URI and other information.
    Gets the description of the resource.
    Get the Input Stream instance for the given Storage Resource.
     
    boolean
     

    Methods inherited from class org.springframework.core.io.AbstractResource

    contentLength, createRelative, equals, exists, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, hashCode, isFile, isOpen, isReadable, lastModified, readableChannel, toString

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.core.io.Resource

    contentLength, createRelative, exists, getContentAsByteArray, getContentAsString, getFile, getFilename, getFilePath, getURI, getURL, isFile, isOpen, isReadable, lastModified, readableChannel

    Methods inherited from interface org.springframework.core.io.WritableResource

    writableChannel
  • Constructor Details

    • OracleStorageResource

      public OracleStorageResource(String bucketName, String objectName, com.oracle.bmc.objectstorage.ObjectStorageClient osClient)
    • OracleStorageResource

      public OracleStorageResource(StorageLocation location, com.oracle.bmc.objectstorage.ObjectStorageClient osClient)
  • Method Details

    • create

      @Nullable public static OracleStorageResource create(String location, com.oracle.bmc.objectstorage.ObjectStorageClient osClient)
      Creates new OracleStorageResource identified by location URI and other information.
      Parameters:
      location - Object URI
      osClient - OCI Storage SDK Client instance
      Returns:
      OracleStorageResource
    • getDescription

      public String getDescription()
      Gets the description of the resource.
      Specified by:
      getDescription in interface org.springframework.core.io.Resource
      Returns:
      String
    • getInputStream

      public InputStream getInputStream() throws IOException
      Get the Input Stream instance for the given Storage Resource.
      Specified by:
      getInputStream in interface org.springframework.core.io.InputStreamSource
      Returns:
      InputStream
      Throws:
      IOException
    • isWritable

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

      public OutputStream getOutputStream()
      Specified by:
      getOutputStream in interface org.springframework.core.io.WritableResource