public static ServiceController < String > addService ( final ServiceName name , final String path , boolean possiblyAbsolute , final String relativeTo , final ServiceTarget serviceTarget ) { if ( possiblyAbsolute && isAbsoluteUnixOrWindowsPath ( path ) ) { return AbsolutePathService . addService ( name , path , serviceTarget ) ; } RelativePathService service = new RelativePathService ( path ) ; ServiceBuilder < String > builder = serviceTarget . addService ( name , service ) . addDependency ( pathNameOf ( relativeTo ) , String . class , service . injectedPath ) ; ServiceController < String > svc = builder . install ( ) ; return svc ; }
Installs a path service .