View Javadoc
1   /*
2    * dpkg - Debian Package library and the Debian Package Maven plugin
3    * (c) Copyright 2016 Gerrit Hohl
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18   */
19  package net.sourceforge.javadpkg;
20  
21  import java.util.List;
22  import java.util.Map;
23  
24  /**
25   * <p>
26   * The copyright of a Debian package.
27   * </p>
28   *
29   * @author Gerrit Hohl (gerrit-hohl@users.sourceforge.net)
30   * @version <b>1.0</b>, 04.05.2016 by Gerrit Hohl
31   */
32  public interface Copyright {
33  	
34  	
35  	/**
36  	 * <p>
37  	 * Returns the format of the copyright.
38  	 * </p>
39  	 * <p>
40  	 * A format is specified by an URI of the format specification.
41  	 * </p>
42  	 * <p>
43  	 * Example: <blockquote>
44  	 * <code>http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/</code>;
45  	 * </blockquote>
46  	 * </p>
47  	 *
48  	 * @return The format.
49  	 */
50  	String getFormat();
51  
52  
53  	/**
54  	 * <p>
55  	 * Returns the name upstream uses for the software.
56  	 * </p>
57  	 * <p>
58  	 * Example: <blockquote><code>SOFTware</code></blockquote>
59  	 * </p>
60  	 *
61  	 * @return The name or <code>null</code>, if no name is set.
62  	 */
63  	String getUpstreamName();
64  
65  
66  	/**
67  	 * <p>
68  	 * Returns the upstream contact.
69  	 * </p>
70  	 * <p>
71  	 * The preferred address(es) to reach the upstream project. May be free-form
72  	 * text, but by convention will usually be written as a list of RFC5322
73  	 * addresses or URIs.
74  	 * </p>
75  	 * <p>
76  	 * Example: <blockquote>
77  	 * <code>John Doe &lt;john.doe@example.com&gt;</code></blockquote>
78  	 * </p>
79  	 *
80  	 * @return The contact or <code>null</code>, if no contact is set.
81  	 */
82  	String getUpstreamContact();
83  
84  
85  	/**
86  	 * <p>
87  	 * Returns the source.
88  	 * </p>
89  	 * <p>
90  	 * Formatted text, no synopsis: an explanation of where the upstream source
91  	 * came from. Typically this would be a URL, but it might be a free-form
92  	 * explanation.
93  	 * </p>
94  	 * <p>
95  	 * Example: <blockquote>
96  	 * <code>http://www.example.com/software/project</code></blockquote>;
97  	 * </p>
98  	 *
99  	 * @return The source or <code>null</code>, if no source is set.
100 	 */
101 	String getSource();
102 
103 
104 	/**
105 	 * <p>
106 	 * Returns the disclaimer.
107 	 * </p>
108 	 * <p>
109 	 * Formatted text, no synopsis: this field is used for non-free or contrib
110 	 * packages to state that they are not part of Debian and to explain why.
111 	 * </p>
112 	 *
113 	 * @return The disclaimer or <code>null</code>, if no disclaimer is set.
114 	 */
115 	String getDisclaimer();
116 
117 
118 	/**
119 	 * <p>
120 	 * Returns the comment.
121 	 * </p>
122 	 * <p>
123 	 * Formatted text, no synopsis: this field can provide additional
124 	 * information. For example, it might quote an e-mail from upstream
125 	 * justifying why the license is acceptable to the main archive, or an
126 	 * explanation of how this version of the package has been forked from a
127 	 * version known to be DFSG-free, even though the current upstream version
128 	 * is not.
129 	 * </p>
130 	 *
131 	 * @return The comment or <code>null</code>, if no comment is set.
132 	 */
133 	String getComment();
134 
135 
136 	/**
137 	 * <p>
138 	 * Returns the license.
139 	 * </p>
140 	 * <p>
141 	 * The returned license can be reference to one of the licenses returned by
142 	 * the {@link #getLicenses()} method.
143 	 * </p>
144 	 *
145 	 * @return The license or <code>null</code>, if no license is set.
146 	 */
147 	CopyrightLicense getLicense();
148 
149 
150 	/**
151 	 * <p>
152 	 * Returns the copyright.
153 	 * </p>
154 	 * <p>
155 	 * Example: <blockquote><code>Copyright 2008 John Smith<br>
156 	 * Copyright 2009 Angela Watts</code></blockquote>
157 	 * </p>
158 	 *
159 	 * @return The copyright or <code>null</code>, if no copyright is set.
160 	 */
161 	String getCopyright();
162 
163 
164 	/**
165 	 * <p>
166 	 * Returns the copyrights for certain files of a Debian package.
167 	 * </p>
168 	 *
169 	 * @return The copyrights.
170 	 */
171 	List<FilesCopyright> getFilesCopyrights();
172 
173 
174 	/**
175 	 * <p>
176 	 * Returns the licenses referred by this copyright or one of copyrights for
177 	 * certain files.
178 	 * </p>
179 	 *
180 	 * @return The licenses.
181 	 * @see #getLicense()
182 	 * @see #getFilesCopyrights()
183 	 * @see FilesCopyright#getLicense()
184 	 */
185 	Map<String, CopyrightLicense> getLicenses();
186 
187 
188 }