001/** 002 * Java Web Archive Toolkit - Software to read and validate ARC, WARC 003 * and GZip files. (http://jwat.org/) 004 * Copyright 2011-2012 Netarkivet.dk (http://netarkivet.dk/) 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.jwat.warc; 019 020/** 021 * WARC/1.1 specification validation relevant information. 022 * 023 * @author nicl 024 */ 025public class WarcValidator11 extends WarcValidatorBase { 026 027 public WarcValidator11(int[] arr) { 028 setVersions(arr); 029 field_policy = new int[RT_INDEX_OF_LAST][FN_INDEX_OF_LAST]; 030 setWarcHeaderPolicyMatrix(); 031 } 032 033 @Override 034 public void setWarcHeaderPolicyMatrix() { 035 WarcValidator10.setWarc10HeaderPolicyMatrix(field_policy); 036 // WARC-Refers-To-Target-URI 037 // WARC-Refers-To-Date 038 for (int i=1; i<=RT_NUMBER; ++i) { 039 field_policy[i][FN_IDX_WARC_REFERS_TO_TARGET_URI] = POLICY_SHALL_NOT; 040 field_policy[i][FN_IDX_WARC_REFERS_TO_DATE] = POLICY_SHALL_NOT; 041 } 042 field_policy[RT_IDX_REVISIT][FN_IDX_WARC_REFERS_TO_TARGET_URI] = POLICY_MAY; 043 field_policy[RT_IDX_REVISIT][FN_IDX_WARC_REFERS_TO_DATE] = POLICY_MAY; 044 } 045 046}