Class Storage


  • public class Storage
    extends Object

    Provides a Storage API client.

    The example below illustrates the Storage API.

    
      import io.nitric.api.storage.Storage;
      ...
    
      byte[] frontData = ...
    
      // Store an file file
      Storage.bucket("inspection-images")
         .file("582764-front-elevation.jpg")
         .write(frontData);
    
      // Retrieve an image file
      byte[] sideData = Storage.bucket("inspection-images")
          .file("582764-side-elevation.jpg")
          .read();
    
      // Delete an image file
      Storage.bucket(bucket)
          .file("582764-rear-elevation.jpg")
          .delete();
     
    See Also:
    Bucket
    • Method Detail

      • bucket

        public static Bucket bucket​(String name)
        Create a new storage bucket with the given name.
        Parameters:
        name - the name of the bucket (required)
        Returns:
        a new storage bucket