[TOC]

  • Prev Class
  • Next Class

org.apache.nutch.urlfilter.validator

Class UrlValidator


public class UrlValidator
extends Object
implements URLFilter

Validates URLs.

Originally based in on php script by Debbie Dyer, validation.php v1.2b, Date: 03/07/02, http://javascript.internet.com. However, this validation now bears little resemblance to the php original.

   Example of usage:
    UrlValidator urlValidator = UrlValidator.get();
    if (urlValidator.isValid("ftp://foo.bar.com/")) {
       System.out.println("url is valid");
    } else {
       System.out.println("url is invalid");
    }

   prints out "url is valid"
  

Based on UrlValidator code from Apache commons-validator.

Field Summary

-    

Fields inherited from interface org.apache.nutch.net.URLFilter

X_POINT_ID

Constructor Summary

Constructors Constructor and Description UrlValidator()

Method Summary

Methods Modifier and Type Method and Description String filter(String urlString) org.apache.hadoop.conf.Configuration getConf() void setConf(org.apache.hadoop.conf.Configuration conf)

-    

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

-  

UrlValidator

public UrlValidator()

Method Detail

-  

filter

public String filter(String urlString)
  - Specified by: 
  - <code>filter</code> in interface <code>URLFilter</code>        
-  

getConf

public org.apache.hadoop.conf.Configuration getConf()
  - Specified by: 
  - <code>getConf</code> in interface <code>org.apache.hadoop.conf.Configurable</code>        
-  

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
  - Specified by: 
  - <code>setConf</code> in interface <code>org.apache.hadoop.conf.Configurable</code>       

  • Prev Class
  • Next Class

Copyright © 2014 The Apache Software Foundation