public class StorageProviderUtil extends Object
Constructor and Description |
---|
StorageProviderUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
compareChecksum(StorageProvider provider,
String spaceId,
String contentId,
String checksum)
Determines if the checksum for a particular piece of content
stored in a StorageProvider matches the expected checksum value.
|
static String |
compareChecksum(String providerChecksum,
String spaceId,
String contentId,
String checksum)
Determines if two checksum values are equal
|
static boolean |
contains(Iterator<String> iterator,
String value)
Determines if a String value is included in a Iterated list.
|
static long |
count(Iterator<String> iterator)
Determines the number of elements in an iteration.
|
static Map<String,String> |
createContentProperties(String absolutePath,
String creator)
Generates a map of all client-side default content properties to be
added with new content.
|
static List<String> |
getList(Iterator<String> iterator)
Creates a list of all of the items in an iteration.
|
static Map<String,String> |
loadProperties(InputStream is)
Loads a stream containing properties and populates a map
with the properties name/value pairs.
|
static Map<String,String> |
removeCalculatedProperties(Map<String,String> contentProperties)
Returns a new map with the calculated properties removed.
|
static ByteArrayInputStream |
storeProperties(Map<String,String> propertiesMap)
Converts properties stored in a Map into a stream for storage purposes.
|
public static Map<String,String> loadProperties(InputStream is) throws StorageException
is
- StorageException
public static ByteArrayInputStream storeProperties(Map<String,String> propertiesMap) throws StorageException
propertiesMap
- StorageException
public static String compareChecksum(StorageProvider provider, String spaceId, String contentId, String checksum) throws StorageException
provider
- The StorageProvider where the content was storedspaceId
- The Space in which the content was storedcontentId
- The Id of the contentchecksum
- The content checksum, either provided or computedStorageException
- if the included checksum does not match
the storage provider generated checksumpublic static String compareChecksum(String providerChecksum, String spaceId, String contentId, String checksum) throws ChecksumMismatchException
providerChecksum
- The checksum provided by the StorageProviderspaceId
- The Space in which the content was storedcontentId
- The Id of the contentchecksum
- The content checksum, either provided or computedChecksumMismatchException
- if the included checksum does not match
the storage provider generated checksumpublic static boolean contains(Iterator<String> iterator, String value)
iterator
- value
- public static long count(Iterator<String> iterator)
iterator
- public static List<String> getList(Iterator<String> iterator)
iterator
- public static Map<String,String> createContentProperties(String absolutePath, String creator)
absolutePath
- creator
- Copyright © 2009–2014 DuraSpace. All rights reserved.