Package rabbit.util

Examples of rabbit.util.Config


    /** Set the config file to use for this proxy.
     * @param conf the name of the file to use for proxy configuration.
     */
    public void setConfig (String conf) throws IOException {
  setConfig (new Config (conf));
    }
View Full Code Here


     */
    public boolean isEvil (String str) {
  if (str == null)
      return false;
  if (adPattern == null) {
      Config conf = con.getProxy ().getConfig ();
      String adLinks = conf.getProperty (getClass ().getName (),
                 "adlinks",
                 "[/.]ad[/.]");
      adPattern = Pattern.compile (adLinks);
  }
  Matcher m = adPattern.matcher (str);
View Full Code Here

     * @param block the html block were filtering.
     * @param pos the position in the block were inserting stuff at.
     * @return the new position in the block.
     */
    protected int insertTokens (HtmlBlock block, int pos) {
  Config config = con.getProxy ().getConfig ();
  block.insertToken (new Token
         (config.getProperty
          (getClass ().getName (),
           "prefix",
           PREFIX)),
         pos++);
  if (config.getProperty (getClass ().getName (),
        "unfilteredlink",
        "true").toLowerCase ().equals ("true")) {
      Tag a = new Tag ("A");
      try {
    URL url = new URL (request.getRequestURI ());
    a.addArg ("HREF", getHref (url));
    block.insertToken (new Token (a), pos++);
    block.insertToken (new Token
           (config.getProperty (getClass ().getName (),
              "link",
              LINK)),
           pos++);
    Tag slasha = new Tag ("/A");
    block.insertToken (new Token (slasha), pos++);
      } catch (MalformedURLException e) {
    // ignore
      }
  }
  block.insertToken (new Token (config.getProperty
              (getClass ().getName (),
               "postfix",
               POSTFIX)),
         pos++);
  return pos;
View Full Code Here

  exception.printStackTrace (sos);
 
  Properties sysprop = System.getProperties ();
 
  HttpProxy proxy = con.getProxy ();
  Config config = proxy.getConfig ();
  String sh = "500 Internal Server Error";
  StringBuilder sb =
      new StringBuilder (HtmlPage.getPageHeader (con, sh));
  sb.append ("You have found a bug in RabbIT please report this" +
       "(together with the URL you tried to visit) to the " +
       "<a href=\"http://www.khelekore.org/rabbit/\" target =" +
       "\"_top\">RabbIT</a> crew.<br><br>\n" +
       "<font size = 4>Connection status</font><br><hr noshade>\n" +
       "status: " + con.getStatus ()  + "<br>\n" +
       "started: " + new Date (con.getStarted ()) + "<br>\n" +
       "keepalive: " + con.getKeepalive () + "<br>\n" +
       "meta: " + con.getMeta () + "<br>\n" +
       "mayusecache: " + con.getMayUseCache () + "<br>\n" +
       "maycache: " + con.getMayCache () + "<br>\n" +
       "mayfilter: " + con.getMayFilter () + "<br>\n"+
       "requestline: " + con.getRequestLine () + "<br>\n" +
       "statuscode: " + con.getStatusCode () + "<br>\n" +
       "extrainfo: " + con.getExtraInfo () + "<br>\n" +           
       "contentlength: " + con.getContentLength () + "<br>\n" +
       "<br>\n" +
       "<font size = 4>Proxy status</font><br>\n<hr noshade>\n" +
       "proxy version: " + proxy.VERSION + "<br>\n" +
       "proxy identity: " + proxy.getServerIdentity () + "<br>\n" +
       "server host: " + proxy.getHost () + "<br>\n" +
       "server port: " + proxy.getPort () + "<br>\n" +
       "accessfilters: " +
       config.getProperty ("Filters", "accessfilters") +
       "<br>\n" +
       "httpinfilters: " +
       config.getProperty ("Filters", "httpinfilters") +
       "<br>\n" +
       "httpoutfilters:" +
       config.getProperty ("Filters", "httpoutfilters") +
       "<br>\n<br>\n" +                 
       "<font size = 4>System properties</font><br>\n" +
       "<hr noshade>\n" +
       "java.version: " +
       sysprop.getProperty ("java.version") + "<br>\n" +
View Full Code Here

TOP

Related Classes of rabbit.util.Config

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.