Class BaseNativeDiscoveryStrategy
- java.lang.Object
-
- uk.co.caprica.vlcj.factory.discovery.strategy.BaseNativeDiscoveryStrategy
-
- All Implemented Interfaces:
NativeDiscoveryStrategy
- Direct Known Subclasses:
DirectoryProviderDiscoveryStrategy
public abstract class BaseNativeDiscoveryStrategy extends Object implements NativeDiscoveryStrategy
Base implementation of a native discovery strategy that searches a list of directories for a list of files.
-
-
Constructor Summary
Constructors Constructor Description BaseNativeDiscoveryStrategy(String[] filenamePatterns, String[] pluginPathFormats)
Create a new native discovery strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
discover()
Attempt to discover the location of the libvlc native shared libraries.boolean
onFound(String path)
Invoked when native shared libraries found.boolean
onSetPluginPath(String path)
Invoked after discovery has completed and found the native shared libraries.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.co.caprica.vlcj.factory.discovery.strategy.NativeDiscoveryStrategy
supported
-
-
-
-
Constructor Detail
-
BaseNativeDiscoveryStrategy
public BaseNativeDiscoveryStrategy(String[] filenamePatterns, String[] pluginPathFormats)
Create a new native discovery strategy.- Parameters:
filenamePatterns
- filename patterns to search for, as regular expressionspluginPathFormats
- directory name templates used to find the VLC plugin directory, printf style.
-
-
Method Detail
-
discover
public final String discover()
Description copied from interface:NativeDiscoveryStrategy
Attempt to discover the location of the libvlc native shared libraries.- Specified by:
discover
in interfaceNativeDiscoveryStrategy
- Returns:
- path containing the shared libraries, or
null
if this strategy did not find them
-
onFound
public boolean onFound(String path)
Description copied from interface:NativeDiscoveryStrategy
Invoked when native shared libraries found.This serves two purposes: the first is to enable the strategy implementation to carry out bespoke work if needed; te second is to indicate whether or not the discovered path should be added to the JNA native library search path.
- Specified by:
onFound
in interfaceNativeDiscoveryStrategy
- Parameters:
path
- directory containing the shared libraries- Returns:
true
if the path should be added to the JNA native search path;false
if not
-
onSetPluginPath
public final boolean onSetPluginPath(String path)
Description copied from interface:NativeDiscoveryStrategy
Invoked after discovery has completed and found the native shared libraries.This method will not be invoked if there is already a VLC_PLUGIN_PATH environment variable set.
- Specified by:
onSetPluginPath
in interfaceNativeDiscoveryStrategy
- Parameters:
path
- directory containing the shared libraries- Returns:
true
if the plugin path was set successfully;false
on error
-
-