Package sunlabs.brazil.util.regexp

Examples of sunlabs.brazil.util.regexp.Regexp$Filter


    List<Filter> keyFilters = new ArrayList<Filter>();
    if (query.hasFilter()) {
      keyFilters.add(query.getFilter());
    }
    if (lastKey != null) {
      Filter lowerBound = DatastoreHelper.makeFilter(DatastoreHelper.KEY_PROPERTY_NAME,
          PropertyFilter.Operator.GREATER_THAN_OR_EQUAL,
          DatastoreHelper.makeValue(lastKey)).build();
      keyFilters.add(lowerBound);
    }
    if (nextKey != null) {
      Filter upperBound = DatastoreHelper.makeFilter(DatastoreHelper.KEY_PROPERTY_NAME,
          PropertyFilter.Operator.LESS_THAN,
          DatastoreHelper.makeValue(nextKey)).build();
      keyFilters.add(upperBound);
    }
    return Query.newBuilder(query).setFilter(makeFilter(keyFilters)).build();
View Full Code Here


  mustExist = props.getProperty(propsPrefix + EXIST) != null;
  persist = props.getProperty(propsPrefix + PERSIST) != null;
  session = props.getProperty(propsPrefix + PROPERTY, session);
  urlPrefix = props.getProperty(propsPrefix + URLPREFIX, "/");

  cookie = new Regexp("(^|; *)" + cookieName + "=([^;]*)");
        return true;
    }
View Full Code Here

    setup(Properties props) {
        String exp = props.getProperty(propsPrefix + MATCH);
        if (exp != null) {
      boolean ignoreCase = (props.getProperty(propsPrefix + CASE)!=null);
      try {
    re = new Regexp(exp, ignoreCase);
      } catch (Exception e) {}
  }

  if (re == null) {
      glob = props.getProperty(propsPrefix + GLOB,
View Full Code Here

  if (match.startsWith("!")) {
      match = match.substring(1);
      invert=true;
  }
  try {
      regexp = new Regexp(match);
  } catch (Exception e) {
      regexp=null;
      server.log(Server.LOG_WARNING, prefix, "Bad expression:" + e);
      return false;
  }
View Full Code Here

    prefix = urlPrefix + prefix;
      }
      request.log(Server.LOG_DIAGNOSTIC, propsPrefix,
        "Checking url against: " + prefix);
      if ((useRegexp &&
            (new Regexp(prefix)).match(request.url,(String[])null)) ||
        request.url.startsWith(prefix)) {
        return false;
      }
  }
View Full Code Here

      server.log(Server.LOG_WARNING, prefix, "missing: " + MATCH);
      return false;
  }
  match = Format.subst(server.props, match);
  try {
      re = new Regexp(match, noCase);
  } catch (Exception e) {
      server.log(Server.LOG_WARNING, prefix, "Bad expression:" + e);
  }
  return (re != null);
    }
View Full Code Here

    init(Server server, String prefix) {
  this.prefix = prefix;
  command = server.props.getProperty(prefix + "command");
        String reString = server.props.getProperty(prefix + "types");
        try {
            types = new Regexp(reString, true);
  } catch (IllegalArgumentException e) {
      server.log(Server.LOG_WARNING, prefix, "Invalid regexp");
      return false;
  }
  return (command != null);
View Full Code Here

        boolean noCase = (server.props.getProperty(prefix + "noCase") != null);
        String reString = server.props.getProperty(prefix + "re");

        try {
            re = new Regexp(reString, noCase);
  } catch (IllegalArgumentException e) {
      server.log(Server.LOG_WARNING, prefix, "Invalid regexp");
      return false;
  }
  return true;
View Full Code Here

   * off before we do the suffix check.  Then this won't look
   * quite so ugly.
   */

  String suffix = props.getProperty(propsPrefix + SUFFIX,"html|txt|xml");
  cookieExp = new Regexp("(^|; *)" + cookieName + "=([^;]*)");
  suffixExp = new Regexp("(\\.(" + suffix + ")|/)$");
  redirectToken = cookieName + ",";
  server.log(Server.LOG_DIAGNOSTIC, propsPrefix,
    "suffix:" + suffix);
  return true;
    }
View Full Code Here

      admin = null;
  }
  try {
      String tmp = props.getProperty(prefix + FILTER, "");
      if (tmp.length() > 0) {
    filter = new Regexp(tmp);
      }
  } catch (IllegalArgumentException e) {
      server.log(Server.LOG_DIAGNOSTIC, prefix, e.getMessage());
      return false;
  }
View Full Code Here

TOP

Related Classes of sunlabs.brazil.util.regexp.Regexp$Filter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.