Class DataUtil


  • public class DataUtil
    extends java.lang.Object
    $INTERFACE is ... User: greg Date: 2/18/14 Time: 12:28 PM
    • Constructor Summary

      Constructors 
      Constructor Description
      DataUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.rundeck.storage.api.ContentFactory<DataContent> contentFactory()
      Base factory for DataContent implementation
      static long copyStream​(java.io.InputStream in, java.io.OutputStream out)  
      static long copyStream​(java.io.InputStream in, java.io.OutputStream out, int bufsize)  
      static DataContent dataWithBytes​(byte[] data)  
      static DataContent dataWithText​(java.lang.String text)  
      static DataContent dataWithText​(java.lang.String text, java.util.Map<java.lang.String,​java.lang.String> meta)  
      static org.rundeck.storage.api.HasInputStream lazyFileStream​(java.io.File data)
      Lazy mechanism for stream loading
      static org.rundeck.storage.api.HasInputStream lazyStream​(java.io.InputStream data)
      Lazy mechanism for stream loading
      static <T extends org.rundeck.storage.api.ContentMeta>
      T
      withBytes​(byte[] data, java.util.Map<java.lang.String,​java.lang.String> meta, org.rundeck.storage.api.ContentFactory<T> factory)
      Returns a read-only FileMeta from the input source
      static <T extends org.rundeck.storage.api.ContentMeta>
      T
      withBytes​(byte[] data, org.rundeck.storage.api.ContentFactory<T> factory)  
      static <T extends org.rundeck.storage.api.ContentMeta>
      T
      withStream​(java.io.InputStream source, java.util.Map<java.lang.String,​java.lang.String> meta, org.rundeck.storage.api.ContentFactory<T> factory)
      Returns a read-only FileMeta from the input source
      static <T extends org.rundeck.storage.api.ContentMeta>
      T
      withStream​(java.io.InputStream source, org.rundeck.storage.api.ContentFactory<T> factory)  
      static <T extends org.rundeck.storage.api.ContentMeta>
      T
      withText​(java.lang.String text, java.util.Map<java.lang.String,​java.lang.String> meta, org.rundeck.storage.api.ContentFactory<T> factory)
      Returns a read-only FileMeta from the input source
      static <T extends org.rundeck.storage.api.ContentMeta>
      T
      withText​(java.lang.String text, org.rundeck.storage.api.ContentFactory<T> factory)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataUtil

        public DataUtil()
    • Method Detail

      • dataWithText

        public static DataContent dataWithText​(java.lang.String text)
      • dataWithText

        public static DataContent dataWithText​(java.lang.String text,
                                               java.util.Map<java.lang.String,​java.lang.String> meta)
      • withText

        public static <T extends org.rundeck.storage.api.ContentMeta> T withText​(java.lang.String text,
                                                                                 org.rundeck.storage.api.ContentFactory<T> factory)
      • withText

        public static <T extends org.rundeck.storage.api.ContentMeta> T withText​(java.lang.String text,
                                                                                 java.util.Map<java.lang.String,​java.lang.String> meta,
                                                                                 org.rundeck.storage.api.ContentFactory<T> factory)
        Returns a read-only FileMeta from the input source
        Type Parameters:
        T - resource type
        Parameters:
        text - text data
        meta - meta data
        factory - factory
        Returns:
        content
      • dataWithBytes

        public static DataContent dataWithBytes​(byte[] data)
      • withBytes

        public static <T extends org.rundeck.storage.api.ContentMeta> T withBytes​(byte[] data,
                                                                                  org.rundeck.storage.api.ContentFactory<T> factory)
      • withBytes

        public static <T extends org.rundeck.storage.api.ContentMeta> T withBytes​(byte[] data,
                                                                                  java.util.Map<java.lang.String,​java.lang.String> meta,
                                                                                  org.rundeck.storage.api.ContentFactory<T> factory)
        Returns a read-only FileMeta from the input source
        Type Parameters:
        T - resource type
        Parameters:
        data - byte[] data
        meta - meta data
        factory - factory
        Returns:
        content
      • withStream

        public static <T extends org.rundeck.storage.api.ContentMeta> T withStream​(java.io.InputStream source,
                                                                                   org.rundeck.storage.api.ContentFactory<T> factory)
      • withStream

        public static <T extends org.rundeck.storage.api.ContentMeta> T withStream​(java.io.InputStream source,
                                                                                   java.util.Map<java.lang.String,​java.lang.String> meta,
                                                                                   org.rundeck.storage.api.ContentFactory<T> factory)
        Returns a read-only FileMeta from the input source
        Type Parameters:
        T - resource type
        Parameters:
        source - data
        meta - meta data
        factory - factory
        Returns:
        content
      • lazyStream

        public static org.rundeck.storage.api.HasInputStream lazyStream​(java.io.InputStream data)
        Lazy mechanism for stream loading
        Parameters:
        data - file
        Returns:
        lazy stream
      • contentFactory

        public static org.rundeck.storage.api.ContentFactory<DataContent> contentFactory()
        Base factory for DataContent implementation
        Returns:
        base factory
      • copyStream

        public static long copyStream​(java.io.InputStream in,
                                      java.io.OutputStream out)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • copyStream

        public static long copyStream​(java.io.InputStream in,
                                      java.io.OutputStream out,
                                      int bufsize)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • lazyFileStream

        public static org.rundeck.storage.api.HasInputStream lazyFileStream​(java.io.File data)
        Lazy mechanism for stream loading
        Parameters:
        data - file
        Returns:
        lazy stream