1 /*
2 * $Id$
3 */
4
5 package org.apache.maven.settings;
6
7 //---------------------------------/
8 //- Imported classes and packages -/
9 //---------------------------------/
10
11 import java.util.Date;
12
13 /**
14 * Download policy.
15 *
16 * @version $Revision$ $Date$
17 */
18 public class RepositoryPolicy implements java.io.Serializable {
19
20
21 //--------------------------/
22 //- Class/Member Variables -/
23 //--------------------------/
24
25 /**
26 *
27 * Whether to use this repository for downloading
28 * this type of
29 * artifact.
30 *
31 */
32 private boolean enabled = true;
33
34 /**
35 *
36 * The frequency for downloading updates - can be
37 * "always",
38 * "daily" (default), "interval:XXX" (in minutes)
39 * or "never"
40 * (only if it doesn't exist locally).
41 *
42 */
43 private String updatePolicy;
44
45 /**
46 *
47 * What to do when verification of an artifact
48 * checksum fails -
49 * warn, fail, etc. Valid values are "fail" or
50 * "warn".
51 *
52 */
53 private String checksumPolicy;
54
55
56 //-----------/
57 //- Methods -/
58 //-----------/
59
60 /**
61 * Get
62 * What to do when verification of an artifact
63 * checksum fails -
64 * warn, fail, etc. Valid values are "fail" or
65 * "warn".
66 *
67 *
68 * @return String
69 */
70 public String getChecksumPolicy()
71 {
72 return this.checksumPolicy;
73 } //-- String getChecksumPolicy()
74
75 /**
76 * Get
77 * The frequency for downloading updates - can be
78 * "always",
79 * "daily" (default), "interval:XXX" (in minutes)
80 * or "never"
81 * (only if it doesn't exist locally).
82 *
83 *
84 * @return String
85 */
86 public String getUpdatePolicy()
87 {
88 return this.updatePolicy;
89 } //-- String getUpdatePolicy()
90
91 /**
92 * Get
93 * Whether to use this repository for downloading
94 * this type of
95 * artifact.
96 *
97 *
98 * @return boolean
99 */
100 public boolean isEnabled()
101 {
102 return this.enabled;
103 } //-- boolean isEnabled()
104
105 /**
106 * Set
107 * What to do when verification of an artifact
108 * checksum fails -
109 * warn, fail, etc. Valid values are "fail" or
110 * "warn".
111 *
112 *
113 * @param checksumPolicy
114 */
115 public void setChecksumPolicy( String checksumPolicy )
116 {
117 this.checksumPolicy = checksumPolicy;
118 } //-- void setChecksumPolicy( String )
119
120 /**
121 * Set
122 * Whether to use this repository for downloading
123 * this type of
124 * artifact.
125 *
126 *
127 * @param enabled
128 */
129 public void setEnabled( boolean enabled )
130 {
131 this.enabled = enabled;
132 } //-- void setEnabled( boolean )
133
134 /**
135 * Set
136 * The frequency for downloading updates - can be
137 * "always",
138 * "daily" (default), "interval:XXX" (in minutes)
139 * or "never"
140 * (only if it doesn't exist locally).
141 *
142 *
143 * @param updatePolicy
144 */
145 public void setUpdatePolicy( String updatePolicy )
146 {
147 this.updatePolicy = updatePolicy;
148 } //-- void setUpdatePolicy( String )
149
150
151 private String modelEncoding = "UTF-8";
152
153 /**
154 * Set an encoding used for reading/writing the model.
155 *
156 * @param modelEncoding the encoding used when reading/writing the model.
157 */
158 public void setModelEncoding( String modelEncoding )
159 {
160 this.modelEncoding = modelEncoding;
161 }
162
163 /**
164 * @return the current encoding used when reading/writing this model.
165 */
166 public String getModelEncoding()
167 {
168 return modelEncoding;
169 }
170 }