com.dtolabs.rundeck.core.storage
Class StorageUtil

java.lang.Object
  extended by com.dtolabs.rundeck.core.storage.StorageUtil

public class StorageUtil
extends java.lang.Object

Provides utility methods for use by the storage layer, or implementing plugins.


Field Summary
static java.lang.String ISO_8601_FORMAT
          Date format for stored date/time
static java.lang.String RES_META_RUNDECK_CONTENT_CREATION_TIME
          Metadata key for the creation time
static java.lang.String RES_META_RUNDECK_CONTENT_LENGTH
          Metadata key for the content size
static java.lang.String RES_META_RUNDECK_CONTENT_MODIFY_TIME
          Metadata key for the modification time
static java.lang.String RES_META_RUNDECK_CONTENT_TYPE
          Metadata key for the content-type
 
Constructor Summary
StorageUtil()
           
 
Method Summary
static StorageTree asStorageTree(Tree<ResourceMeta> impl)
          Coerce a Tree of ResourceMeta into A StorageTree
static ResourceMetaBuilder create()
          Create a new builder
static ResourceMetaBuilder create(java.util.Map<java.lang.String,java.lang.String> meta)
          Create a new builder with a set of metadata
static ContentFactory<ResourceMeta> factory()
          Return a factory for ResourceMeta
static java.lang.String formatDate(java.util.Date time)
           
static
<S> StorageTree
resolvedTree(S context, ExtTree<S,ResourceMeta> authStorage)
          Create a StorageTree using authorization context and authorizing tree
static ResourceMeta withStream(HasInputStream stream, java.util.Map<java.lang.String,java.lang.String> meta)
          Construct a resource
static ResourceMeta withStream(java.io.InputStream stream, java.util.Map<java.lang.String,java.lang.String> meta)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RES_META_RUNDECK_CONTENT_TYPE

public static final java.lang.String RES_META_RUNDECK_CONTENT_TYPE
Metadata key for the content-type

See Also:
Constant Field Values

RES_META_RUNDECK_CONTENT_LENGTH

public static final java.lang.String RES_META_RUNDECK_CONTENT_LENGTH
Metadata key for the content size

See Also:
Constant Field Values

RES_META_RUNDECK_CONTENT_CREATION_TIME

public static final java.lang.String RES_META_RUNDECK_CONTENT_CREATION_TIME
Metadata key for the creation time

See Also:
Constant Field Values

RES_META_RUNDECK_CONTENT_MODIFY_TIME

public static final java.lang.String RES_META_RUNDECK_CONTENT_MODIFY_TIME
Metadata key for the modification time

See Also:
Constant Field Values

ISO_8601_FORMAT

public static final java.lang.String ISO_8601_FORMAT
Date format for stored date/time

See Also:
Constant Field Values
Constructor Detail

StorageUtil

public StorageUtil()
Method Detail

factory

public static ContentFactory<ResourceMeta> factory()
Return a factory for ResourceMeta

Returns:

create

public static ResourceMetaBuilder create()
Create a new builder

Returns:
builder

create

public static ResourceMetaBuilder create(java.util.Map<java.lang.String,java.lang.String> meta)
Create a new builder with a set of metadata

Parameters:
meta - original metadata
Returns:
builder

withStream

public static ResourceMeta withStream(HasInputStream stream,
                                      java.util.Map<java.lang.String,java.lang.String> meta)
Construct a resource

Parameters:
stream -
meta -
Returns:

withStream

public static ResourceMeta withStream(java.io.InputStream stream,
                                      java.util.Map<java.lang.String,java.lang.String> meta)

asStorageTree

public static StorageTree asStorageTree(Tree<ResourceMeta> impl)
Coerce a Tree of ResourceMeta into A StorageTree

Parameters:
impl - the tree
Returns:
a StorageTree

formatDate

public static java.lang.String formatDate(java.util.Date time)

resolvedTree

public static <S> StorageTree resolvedTree(S context,
                                           ExtTree<S,ResourceMeta> authStorage)
Create a StorageTree using authorization context and authorizing tree

Parameters:
context - auth context
authStorage - authorizing storage tree
Returns:
StorageTree for the authorization context