/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * See LICENSE.txt included in this distribution for the specific * language governing permissions and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at LICENSE.txt. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2009 - 2011 Jens Elkner. */ package org.opensolaris.opengrok.web; import org.apache.commons.jrcs.diff.Revision; import org.opensolaris.opengrok.analysis.FileAnalyzer.Genre; /** * A simple container to store the data required to generated a view of diffs * for a certain versioned file. * NOTE: * For HTML revision escaping is usually not needed, but filenames should be. * For URI's both, filenames and revisions, should be encoded. * * @author Jens Elkner * @version $Revision$ */ public class DiffData { /** request URI, that has been used to fetch this data, i.e. something like * /$webapp/diff/$path/$filename (NOTE: no query string!). * E.g.: /source/diff/opengrok/src/org/opensolaris/opengrok/web/PageConfig.java */ public String reqURI; /** the genre of the requested diff */ public Genre genre; /** the orignal and new revision container */ public Revision revision; /** file part of the URI request parameter 'r1' (decoded). * E.g. /opengrok/src/org/opensolaris/opengrok/web/PageConfig.java */ public String fp1; /** file part of the URI request parameter 'r2' (decoded). * E.g. /opengrok/src/org/opensolaris/opengrok/web/PageConfig.java */ public String fp2; /** revision part of the URI request parameter 'r1' (decoded). * E.g. 1374:a34d0ff8421d */ public String rev1; /** revision part of the URI request parameter 'r2' (decoded). * E.g. 1402:4bad063b48d3 */ public String rev2; /** the URI encoded request parameter 'r1' ({@link #fp1}@{@link #rev1}). * E.g. /opengrok/src/org/opensolaris/opengrok/web/PageConfig.java@1374:a34d0ff8421d */ public String rp1; /** the URI encoded request parameter 'r2' ({@link #fp2}@{@link #rev2}). * E.g. /opengrok/src/org/opensolaris/opengrok/web/PageConfig.java@1402:4bad063b48d3 */ public String rp2; /** the content of the original {@link #rev1} and new {@link #rev2} file. * Each entry in file[n] represents exactly one line of source. */ public String[][] file; /** html encoded error message to show, if diffs are not available */ public String errorMsg; /** If {@code true} a full diff is desired (request parameter {@code full=1} */ public boolean full; /** How should the data be displayed (request parameter {@code format} */ public DiffType type; }