Class LocatorImpl

  • All Implemented Interfaces:
    ExecutableLocator

    @Service
    @Properties(@Property(name="service.description",value="CQ Executable Locator"))
    public class LocatorImpl
    extends Object
    implements ExecutableLocator
    Finds an executable on a configurable search path.
    • Field Detail

      • PROP_SEARCH_PATH

        @Property({"/opt/local/bin","/usr/local/bin","PATH"})
        public static final String PROP_SEARCH_PATH
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocatorImpl

        public LocatorImpl()
        Default constructor for SCR.
      • LocatorImpl

        public LocatorImpl​(String[] searchPath)
        Constructor for non-OSGi component usage.
        Parameters:
        searchPath - list of search paths
    • Method Detail

      • getPath

        public String getPath​(String cmd)
        Description copied from interface: ExecutableLocator
        Returns the absolute path to an executable, if found, or null if it could not be found.
        Specified by:
        getPath in interface ExecutableLocator
        Parameters:
        cmd - the name of an executable file (e.g. "ffmpeg")
        Returns:
        absolute path to executable or null
      • getPathEnv

        public static String[] getPathEnv()