View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.model;
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       * Whether to use this repository for downloading this type of
27       * artifact.
28       */
29      private boolean enabled = true;
30  
31      /**
32       * 
33       *             
34       *             The frequency for downloading updates - can be
35       *             <code>always,</code>
36       *             <code>daily</code>
37       *             (default),
38       *             <code>interval:XXX</code>
39       *             (in minutes) or
40       *             <code>never</code>
41       *             (only if it doesn't exist locally).
42       *             
43       *           
44       */
45      private String updatePolicy;
46  
47      /**
48       * 
49       *             
50       *             What to do when verification of an artifact
51       * checksum fails. Valid values are
52       *             <code>ignore</code>
53       *             ,
54       *             <code>fail</code>
55       *             or
56       *             <code>warn</code>
57       *             (the default).
58       *             
59       *           
60       */
61      private String checksumPolicy;
62  
63  
64        //-----------/
65       //- Methods -/
66      //-----------/
67  
68      /**
69       * Get 
70       *             
71       *             What to do when verification of an artifact
72       * checksum fails. Valid values are
73       *             <code>ignore</code>
74       *             ,
75       *             <code>fail</code>
76       *             or
77       *             <code>warn</code>
78       *             (the default).
79       *             
80       *           
81       * 
82       * @return String
83       */
84      public String getChecksumPolicy()
85      {
86          return this.checksumPolicy;
87      } //-- String getChecksumPolicy() 
88  
89      /**
90       * Get 
91       *             
92       *             The frequency for downloading updates - can be
93       *             <code>always,</code>
94       *             <code>daily</code>
95       *             (default),
96       *             <code>interval:XXX</code>
97       *             (in minutes) or
98       *             <code>never</code>
99       *             (only if it doesn't exist locally).
100      *             
101      *           
102      * 
103      * @return String
104      */
105     public String getUpdatePolicy()
106     {
107         return this.updatePolicy;
108     } //-- String getUpdatePolicy() 
109 
110     /**
111      * Get whether to use this repository for downloading this type
112      * of artifact.
113      * 
114      * @return boolean
115      */
116     public boolean isEnabled()
117     {
118         return this.enabled;
119     } //-- boolean isEnabled() 
120 
121     /**
122      * Set 
123      *             
124      *             What to do when verification of an artifact
125      * checksum fails. Valid values are
126      *             <code>ignore</code>
127      *             ,
128      *             <code>fail</code>
129      *             or
130      *             <code>warn</code>
131      *             (the default).
132      *             
133      *           
134      * 
135      * @param checksumPolicy
136      */
137     public void setChecksumPolicy( String checksumPolicy )
138     {
139         this.checksumPolicy = checksumPolicy;
140     } //-- void setChecksumPolicy( String ) 
141 
142     /**
143      * Set whether to use this repository for downloading this type
144      * of artifact.
145      * 
146      * @param enabled
147      */
148     public void setEnabled( boolean enabled )
149     {
150         this.enabled = enabled;
151     } //-- void setEnabled( boolean ) 
152 
153     /**
154      * Set 
155      *             
156      *             The frequency for downloading updates - can be
157      *             <code>always,</code>
158      *             <code>daily</code>
159      *             (default),
160      *             <code>interval:XXX</code>
161      *             (in minutes) or
162      *             <code>never</code>
163      *             (only if it doesn't exist locally).
164      *             
165      *           
166      * 
167      * @param updatePolicy
168      */
169     public void setUpdatePolicy( String updatePolicy )
170     {
171         this.updatePolicy = updatePolicy;
172     } //-- void setUpdatePolicy( String ) 
173 
174 
175     private String modelEncoding = "UTF-8";
176 
177     /**
178      * Set an encoding used for reading/writing the model.
179      *
180      * @param modelEncoding the encoding used when reading/writing the model.
181      */
182     public void setModelEncoding( String modelEncoding )
183     {
184         this.modelEncoding = modelEncoding;
185     }
186 
187     /**
188      * @return the current encoding used when reading/writing this model.
189      */
190     public String getModelEncoding()
191     {
192         return modelEncoding;
193     }
194 }