Class ResourceLocator
- Since:
- 3.17
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Optional<ImageDescriptor>imageDescriptorFromBundle(Class<?> classFromBundle, String imageFilePath) Returns a newOptional<ImageDescriptor>Optional.empty().static Optional<ImageDescriptor>imageDescriptorFromBundle(String bundleSymbolicName, String imageFilePath) Returns a newOptional<ImageDescriptor>Optional.empty().
- 
Constructor Details- 
ResourceLocatorpublic ResourceLocator()
 
- 
- 
Method Details- 
locateReturns anOptional<URL>Optional.empty()if the URL could not be computed or created.- Parameters:
- bundleSymbolicName- the- Bundlesymbolic name
- filePath- the path of the resource file in the given bundle, relative to the root of the bundle
- Returns:
- an Optional<URL>Optional.empty().
- See Also:
 
- 
locateReturns anOptional<URL>Optional.empty()if the URL could not be computed or created.- Parameters:
- classFromBundle- A class defined by a bundle class loader.
- filePath- the path of the resource file in the given bundle, relative to the root of the bundle
- Returns:
- an Optional<URL>Optional.empty().
- See Also:
 
- 
imageDescriptorFromBundlepublic static Optional<ImageDescriptor> imageDescriptorFromBundle(String bundleSymbolicName, String imageFilePath) Returns a newOptional<ImageDescriptor>Optional.empty().This is a convenience method that simply locates the image file in within the bundle. The path is relative to the root of the bundle, and takes into account files coming from bundle fragments. The path may include $arg$ elements. However, the path must not have a leading "." or path separator. Clients should use a path like "icons/mysample.png" rather than "./icons/mysample.png" or "/icons/mysample.png". - Parameters:
- bundleSymbolicName- the- Bundlesymbolic name
- imageFilePath- the path of the image file in the given bundle, relative to the root of the bundle
- Returns:
- Optional<- ImageDescriptor>- Optional.empty()
- See Also:
 
- 
imageDescriptorFromBundlepublic static Optional<ImageDescriptor> imageDescriptorFromBundle(Class<?> classFromBundle, String imageFilePath) Returns a newOptional<ImageDescriptor>Optional.empty().This is a convenience method that simply locates the image file in within the bundle. The path is relative to the root of the bundle, and takes into account files coming from bundle fragments. The path may include $arg$ elements. However, the path must not have a leading "." or path separator. Clients should use a path like "icons/mysample.png" rather than "./icons/mysample.png" or "/icons/mysample.png". - Parameters:
- classFromBundle- A class defined by a bundle class loader.
- imageFilePath- the path of the image file in the given bundle, relative to the root of the bundle
- Returns:
- Optional<- ImageDescriptor>- Optional.empty()
- See Also:
 
 
-