Package org.rundeck.storage.data
Class DataUtil
- java.lang.Object
-
- org.rundeck.storage.data.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 implementationstatic 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 loadingstatic org.rundeck.storage.api.HasInputStream
lazyStream(java.io.InputStream data)
Lazy mechanism for stream loadingstatic <T extends org.rundeck.storage.api.ContentMeta>
TwithBytes(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 sourcestatic <T extends org.rundeck.storage.api.ContentMeta>
TwithBytes(byte[] data, org.rundeck.storage.api.ContentFactory<T> factory)
static <T extends org.rundeck.storage.api.ContentMeta>
TwithStream(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 sourcestatic <T extends org.rundeck.storage.api.ContentMeta>
TwithStream(java.io.InputStream source, org.rundeck.storage.api.ContentFactory<T> factory)
static <T extends org.rundeck.storage.api.ContentMeta>
TwithText(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 sourcestatic <T extends org.rundeck.storage.api.ContentMeta>
TwithText(java.lang.String text, org.rundeck.storage.api.ContentFactory<T> factory)
-
-
-
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 datameta
- meta datafactory
- 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[] datameta
- meta datafactory
- 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
- datameta
- meta datafactory
- 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
-
-