X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fbasic%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcrawler%2Fimpl%2FPageTypeConfig.java;fp=crawler%2Fbasic%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcrawler%2Fimpl%2FPageTypeConfig.java;h=b7fa5a3c7b62fd67d344dd6a2951d5b2f4fab647;hb=62f165891f08ae532b5a794af11d7338a93f9a43;hp=0000000000000000000000000000000000000000;hpb=07cedd3f0730646ea35a7f668b3e1e872a4605d9;p=utils diff --git a/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageTypeConfig.java b/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageTypeConfig.java new file mode 100644 index 00000000..b7fa5a3c --- /dev/null +++ b/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageTypeConfig.java @@ -0,0 +1,43 @@ +/* + * Copyright 2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.wamblee.crawler.impl; + +import org.wamblee.crawler.PageRequest; + +/** + * Page type configuration. + */ +public class PageTypeConfig extends ConfigItem { + + /** + * Constructs the configuration. + * @param aPattern Page type pattern. + * @param aRequest Page request. + */ + public PageTypeConfig(String aPattern, PageRequest aRequest) { + super(aPattern, aRequest); + } + + /** + * Returns the request in case the type matches. + * @param aType Page type. + * @return Request if the type matches, null otherwise. + */ + public PageRequest getRequest(String aType) { + return match(aType); + } +}