Class ImageDescriptorFactoryImpl
java.lang.Object
com.atlassian.jira.lookandfeel.image.ImageDescriptorFactoryImpl
- All Implemented Interfaces:
ImageDescriptorFactory
Used to construct
ImageDescriptor objects.
Constructed objects need to be closed- Since:
- v7.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImageDescriptorFactoryImpl(I18nHelper i18nHelper, com.atlassian.sal.api.net.RequestFactory<com.atlassian.sal.api.net.Request<?, com.atlassian.sal.api.net.Response>> requestFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisUrlSupported(String url) Checks if url can be used to constructImageDescriptorusingwithUrl(String)withRequest(String parameterName, webwork.multipart.MultiPartRequestWrapper multiPartRequest) If provided url is supported it constructsImageDescriptorobject with it
-
Constructor Details
-
ImageDescriptorFactoryImpl
public ImageDescriptorFactoryImpl(I18nHelper i18nHelper, com.atlassian.sal.api.net.RequestFactory<com.atlassian.sal.api.net.Request<?, com.atlassian.sal.api.net.Response>> requestFactory)
-
-
Method Details
-
isUrlSupported
Checks if url can be used to constructImageDescriptorusingwithUrl(String)- Specified by:
isUrlSupportedin interfaceImageDescriptorFactory- Parameters:
url- - url to check- Returns:
- true if url can be used; false if url should not be used (will cause Exception)
-
withUrl
If provided url is supported it constructsImageDescriptorobject with it- Specified by:
withUrlin interfaceImageDescriptorFactory- Parameters:
url- - url to createImageDescriptorwith- Returns:
ImageDescriptorobject containing image data that was pointed by provided url- Throws:
IOException- - when fails to open stream to image resource provided by url. Can occur with:IllegalArgumentException- - if url is not supported- See Also:
-
withRequest
public ImageDescriptor withRequest(String parameterName, webwork.multipart.MultiPartRequestWrapper multiPartRequest) throws IOException - Specified by:
withRequestin interfaceImageDescriptorFactory- Parameters:
parameterName- - parameter name for uploaded image contained in providedMultiPartRequestWrappermultiPartRequest- - multi part request containing image- Returns:
ImageDescriptorobject containing image data uploaded by request- Throws:
IOException- - with constructor forFileInputStream(String)
-