Package com.psddev.dari.util
Class StorageItem.Static
java.lang.Object
com.psddev.dari.util.StorageItem.Static
- Enclosing interface:
StorageItem
Storage item utility methods.
The factory methods, create() and createUrl(java.lang.String), use settings to construct
instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddMetadata(StorageItem item, String key, String value) Adds the metadata with the givenkeyandvalueto the givenitem.static StorageItemcopy(StorageItem item, String newStorage) Copies the giveniteminto the givennewStoragesystem and returns the newly created item.static StorageItemcreate()Creates an item in the default storage.static StorageItemCreates an item in the givenstorage.static UrlStorageItemCreates a one-off storage item backed by the givenurl.static StorageItemgetGzippedResource(String storage, javax.servlet.ServletContext servletContext, String servletPath) Deprecated, for removal: This API element is subject to removal in a future version.static StorageItemgetPlainResource(String storage, javax.servlet.ServletContext servletContext, String servletPath) Deprecated, for removal: This API element is subject to removal in a future version.UseCdn.getUrl(String)instead.Returns an unmodifiable set of all storage names.static voidremoveAllMetadata(StorageItem item, String key) Removes all metadata associated with the givenkeyfrom the givenitem.static voidremoveMetadata(StorageItem item, String key, String value) Removes the metadata with the givenkeyandvaluefrom the givenitem.static voidresetListeners(StorageItem item)
-
Constructor Details
-
Static
public Static()
-
-
Method Details
-
createIn
Creates an item in the givenstorage. -
create
Creates an item in the default storage. -
createUrl
Creates a one-off storage item backed by the givenurl. -
getStorages
Returns an unmodifiable set of all storage names. -
copy
Copies the giveniteminto the givennewStoragesystem and returns the newly created item.- Throws:
IOException
-
addMetadata
Adds the metadata with the givenkeyandvalueto the givenitem. -
removeMetadata
Removes the metadata with the givenkeyandvaluefrom the givenitem. -
removeAllMetadata
Removes all metadata associated with the givenkeyfrom the givenitem. -
resetListeners
-
getPlainResource
@Deprecated(since="5.0.0", forRemoval=true) public static StorageItem getPlainResource(String storage, javax.servlet.ServletContext servletContext, String servletPath) Deprecated, for removal: This API element is subject to removal in a future version.UseCdn.getUrl(String)instead.Finds the resource at the givenservletPathwithin the givenservletContext, stores it in the givenstorage, and returns the storage item that represents it.- Parameters:
storage- Nullable (to indicate default storage).
-
getGzippedResource
@Deprecated(since="5.0.0", forRemoval=true) public static StorageItem getGzippedResource(String storage, javax.servlet.ServletContext servletContext, String servletPath) Deprecated, for removal: This API element is subject to removal in a future version.UseCdn.getUrl(String)instead.Finds and gzips the resource at the at the givenservletPathwithin the givenservletContext, stores it in the givenstorage, and returns the storage item that represents it.- Parameters:
storage- Nullable (to indicate default storage).
-
Cdn.getUrl(String)instead.