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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isUrlSupported
(String url) Checks if url can be used to constructImageDescriptor
usingwithUrl(String)
withRequest
(String parameterName, webwork.multipart.MultiPartRequestWrapper multiPartRequest) If provided url is supported it constructsImageDescriptor
object with it
-
Constructor Details
-
ImageDescriptorFactoryImpl
-
-
Method Details
-
isUrlSupported
Checks if url can be used to constructImageDescriptor
usingwithUrl(String)
- Specified by:
isUrlSupported
in 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 constructsImageDescriptor
object with it- Specified by:
withUrl
in interfaceImageDescriptorFactory
- Parameters:
url
- - url to createImageDescriptor
with- Returns:
ImageDescriptor
object 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:
withRequest
in interfaceImageDescriptorFactory
- Parameters:
parameterName
- - parameter name for uploaded image contained in providedMultiPartRequestWrapper
multiPartRequest
- - multi part request containing image- Returns:
ImageDescriptor
object containing image data uploaded by request- Throws:
IOException
- - with constructor forFileInputStream(String)
-