Class Locate


  • public class Locate
    extends java.lang.Object
    salt.modules.locate Module for using the mlocate utilities.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Locate.LocateOpts
      All possible options for "locate" method.
      static class  Locate.Stats
      Locate module result object
    • Constructor Summary

      Constructors 
      Constructor Description
      Locate()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static LocalCall<java.util.List<java.lang.String>> locate​(java.lang.String pattern, java.util.Optional<java.lang.String> database, java.util.Optional<java.lang.Integer> limit, java.util.Optional<Locate.LocateOpts> options)
      Performs a file lookup.
      static LocalCall<Locate.Stats> stats()
      Returns statistics about the locate database.
      static LocalCall<java.util.List<java.lang.String>> updatedb()
      Updates the locate database.
      static LocalCall<java.util.List<java.lang.String>> version()
      Returns the version of locate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VERSION

        private static final LocalCall<java.util.List<java.lang.String>> VERSION
      • UPDATEDB

        private static final LocalCall<java.util.List<java.lang.String>> UPDATEDB
    • Constructor Detail

      • Locate

        public Locate()
    • Method Detail

      • version

        public static LocalCall<java.util.List<java.lang.String>> version()
        Returns the version of locate.
        The result is a list of Strings representing each a line of the output of the 'locate --v' execution.
        Returns:
        The LocalCall object to make the call
      • updatedb

        public static LocalCall<java.util.List<java.lang.String>> updatedb()
        Updates the locate database.
        A successful result will return an empty list of Strings.
        If any error is returned, then a list of Strings representing each a line of the error output is returned.
        Returns:
        The LocalCall object to make the call
      • locate

        public static LocalCall<java.util.List<java.lang.String>> locate​(java.lang.String pattern,
                                                                         java.util.Optional<java.lang.String> database,
                                                                         java.util.Optional<java.lang.Integer> limit,
                                                                         java.util.Optional<Locate.LocateOpts> options)
        Performs a file lookup. Valid options (and their defaults) are:
        • basename=False
        • count=False
        • existing=False
        • follow=True
        • ignore=False
        • nofollow=False
        • wholename=True
        • regex=False
        Parameters:
        pattern - The pattern to search
        database - Replace the default database.
        limit - Set the maximum number of results.
        options - More options to mofify the search.
        Returns:
        The LocalCall object to make the call