|
19 | 19 |
|
20 | 20 | /*
|
21 | 21 | * Copyright (c) 2009, 2011, Jens Elkner.
|
22 |
| - * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. |
| 22 | + * Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. |
23 | 23 | * Portions Copyright (c) 2020, Chris Fraire <[email protected]>.
|
24 | 24 | */
|
25 |
| -package org.opengrok.indexer.web; |
| 25 | +package org.opengrok.web; |
26 | 26 |
|
27 | 27 | import org.opengrok.indexer.analysis.AbstractAnalyzer;
|
28 | 28 | import org.suigeneris.jrcs.diff.Revision;
|
29 | 29 |
|
30 | 30 | /**
|
31 |
| - * A simple container to store the data required to generated a view of diffs |
| 31 | + * A simple container to store the data required to generate a view of diffs |
32 | 32 | * for a certain versioned file.
|
33 | 33 | *
|
34 | 34 | * @author Jens Elkner
|
35 |
| - * @version $Revision$ |
36 | 35 | */
|
37 | 36 | public class DiffData {
|
38 |
| - |
39 | 37 | /** the directory which contains the given file wrt. to the source root directory. */
|
40 |
| - public String path; |
| 38 | + private final String path; |
41 | 39 | /** the HTML escaped filename used. */
|
42 |
| - public String filename; |
| 40 | + private final String filename; |
43 | 41 | /** the genre of the requested diff. */
|
44 |
| - public AbstractAnalyzer.Genre genre; |
| 42 | + AbstractAnalyzer.Genre genre; |
45 | 43 | /** the original and new revision container. */
|
46 |
| - public Revision revision; |
47 |
| - /** the URI encoded parameter values of the request. {@code param[0]} |
48 |
| - * belongs to {@code r1}, {@code param[1]} to {@code r2}. */ |
49 |
| - public String[] param; |
| 44 | + Revision revision; |
| 45 | + /** |
| 46 | + * the URI encoded parameter values of the request. {@code param[0]} |
| 47 | + * belongs to {@code r1}, {@code param[1]} to {@code r2}. |
| 48 | + */ |
| 49 | + String[] param; |
50 | 50 | /** the revision names extracted from {@link #param}. */
|
51 |
| - public String[] rev; |
52 |
| - /** the content of the original and new file line-by-line corresponding |
53 |
| - * with {@link #rev}. */ |
54 |
| - public String[][] file; |
| 51 | + String[] rev; |
| 52 | + /** the content of the original and new file line-by-line corresponding with {@link #rev}. */ |
| 53 | + String[][] file; |
55 | 54 | /** error message to show, if diffs are not available. */
|
56 |
| - public String errorMsg; |
| 55 | + String errorMsg; |
57 | 56 | /** If {@code true} a full diff is desired. */
|
58 |
| - public boolean full; |
| 57 | + boolean full; |
59 | 58 | /** How should the data be displayed (request parameter {@code format}. */
|
60 |
| - public DiffType type; |
| 59 | + DiffType type; |
| 60 | + |
| 61 | + public DiffData(String path, String filename) { |
| 62 | + this.path = path; |
| 63 | + this.filename = filename; |
| 64 | + |
| 65 | + this.rev = new String[2]; |
| 66 | + this.file = new String[2][]; |
| 67 | + this.param = new String[2]; |
| 68 | + } |
| 69 | + |
| 70 | + public String getPath() { |
| 71 | + return path; |
| 72 | + } |
| 73 | + |
| 74 | + public String getFilename() { |
| 75 | + return filename; |
| 76 | + } |
| 77 | + |
| 78 | + public AbstractAnalyzer.Genre getGenre() { |
| 79 | + return genre; |
| 80 | + } |
| 81 | + |
| 82 | + public Revision getRevision() { |
| 83 | + return revision; |
| 84 | + } |
| 85 | + |
| 86 | + public String getParam(int index) { |
| 87 | + return param[index]; |
| 88 | + } |
| 89 | + |
| 90 | + public String getRev(int index) { |
| 91 | + return rev[index]; |
| 92 | + } |
| 93 | + |
| 94 | + public String[] getFile(int index) { |
| 95 | + return file[index]; |
| 96 | + } |
| 97 | + |
| 98 | + public String getErrorMsg() { |
| 99 | + return errorMsg; |
| 100 | + } |
| 101 | + |
| 102 | + public boolean isFull() { |
| 103 | + return full; |
| 104 | + } |
| 105 | + |
| 106 | + public DiffType getType() { |
| 107 | + return type; |
| 108 | + } |
61 | 109 | }
|
0 commit comments