1 /* 2 Licensed to the Apache Software Foundation (ASF) under one 3 or more contributor license agreements. See the NOTICE file 4 distributed with this work for additional information 5 regarding copyright ownership. The ASF licenses this file 6 to you under the Apache License, Version 2.0 (the 7 "License"); you may not use this file except in compliance 8 with the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, 13 software distributed under the License is distributed on an 14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 KIND, either express or implied. See the License for the 16 specific language governing permissions and limitations 17 under the License. 18 =================== DO NOT EDIT THIS FILE ==================== 19 Generated by Modello 2.4.0, 20 any modifications will be overwritten. 21 ============================================================== 22 */ 23 24 package org.apache.maven.settings; 25 26 /** 27 * 28 * A download mirror for a given repository. 29 * 30 * 31 * @version $Revision$ $Date$ 32 */ 33 @SuppressWarnings( "all" ) 34 public class Mirror 35 extends IdentifiableBase 36 implements java.io.Serializable, java.lang.Cloneable 37 { 38 39 //--------------------------/ 40 //- Class/Member Variables -/ 41 //--------------------------/ 42 43 /** 44 * 45 * 46 * A repository id or (since Maven 2.0.9) an 47 * expression matching one or many repository ids to mirror, 48 * e.g., 49 * <code>central</code> or <code>*,!repo1</code>. 50 * <code>*</code> (since Maven 2.0.5), 51 * <code>external:*</code> (since Maven 2.0.9) and 52 * <code>external:http:*</code> (since Maven 3.8.0) have 53 * a special meaning: see <a 54 * href="/guides/mini/guide-mirror-settings.html">Mirror 55 * Settings</a> guide. 56 * 57 * 58 */ 59 private String mirrorOf; 60 61 /** 62 * 63 * The optional name that describes the mirror. 64 * 65 */ 66 private String name; 67 68 /** 69 * The URL of the mirror repository. 70 */ 71 private String url; 72 73 /** 74 * 75 * 76 * The layout of the mirror repository. 77 * <br><b>Since</b>: Maven 3 78 * 79 * . 80 */ 81 private String layout = "default"; 82 83 /** 84 * 85 * 86 * The layouts of repositories being mirrored. This 87 * value can be used to restrict the usage 88 * of the mirror to repositories with a matching 89 * layout (apart from a matching id). 90 * <br><b>Since</b>: Maven 3 91 * 92 * . 93 */ 94 private String mirrorOfLayouts = "default,legacy"; 95 96 /** 97 * 98 * 99 * Whether this mirror should be blocked from any 100 * download request but fail the download process, explaining 101 * why. 102 * <br><b>Default value is</b>: <code>false</code> 103 * <br><b>Since</b>: Maven 3.8.0 104 * 105 * . 106 */ 107 private boolean blocked = false; 108 109 110 //-----------/ 111 //- Methods -/ 112 //-----------/ 113 114 /** 115 * Method clone. 116 * 117 * @return Mirror 118 */ 119 public Mirror clone() 120 { 121 try 122 { 123 Mirror copy = (Mirror) super.clone(); 124 125 return copy; 126 } 127 catch ( java.lang.Exception ex ) 128 { 129 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() 130 + " does not support clone()" ).initCause( ex ); 131 } 132 } //-- Mirror clone() 133 134 /** 135 * Get the layout of the mirror repository. 136 * <br><b>Since</b>: Maven 3. 137 * 138 * @return String 139 */ 140 public String getLayout() 141 { 142 return this.layout; 143 } //-- String getLayout() 144 145 /** 146 * Get a repository id or (since Maven 2.0.9) an expression 147 * matching one or many repository ids to mirror, e.g., 148 * <code>central</code> or <code>*,!repo1</code>. 149 * <code>*</code> (since Maven 2.0.5), 150 * <code>external:*</code> (since Maven 2.0.9) and 151 * <code>external:http:*</code> (since Maven 3.8.0) have 152 * a special meaning: see <a 153 * href="/guides/mini/guide-mirror-settings.html">Mirror 154 * Settings</a> guide. 155 * 156 * @return String 157 */ 158 public String getMirrorOf() 159 { 160 return this.mirrorOf; 161 } //-- String getMirrorOf() 162 163 /** 164 * Get the layouts of repositories being mirrored. This value 165 * can be used to restrict the usage 166 * of the mirror to repositories with a matching 167 * layout (apart from a matching id). 168 * <br><b>Since</b>: Maven 3. 169 * 170 * @return String 171 */ 172 public String getMirrorOfLayouts() 173 { 174 return this.mirrorOfLayouts; 175 } //-- String getMirrorOfLayouts() 176 177 /** 178 * Get the optional name that describes the mirror. 179 * 180 * @return String 181 */ 182 public String getName() 183 { 184 return this.name; 185 } //-- String getName() 186 187 /** 188 * Get the URL of the mirror repository. 189 * 190 * @return String 191 */ 192 public String getUrl() 193 { 194 return this.url; 195 } //-- String getUrl() 196 197 /** 198 * Get whether this mirror should be blocked from any download 199 * request but fail the download process, explaining why. 200 * <br><b>Default value is</b>: <code>false</code> 201 * <br><b>Since</b>: Maven 3.8.0. 202 * 203 * @return boolean 204 */ 205 public boolean isBlocked() 206 { 207 return this.blocked; 208 } //-- boolean isBlocked() 209 210 /** 211 * Set whether this mirror should be blocked from any download 212 * request but fail the download process, explaining why. 213 * <br><b>Default value is</b>: <code>false</code> 214 * <br><b>Since</b>: Maven 3.8.0. 215 * 216 * @param blocked a blocked object. 217 */ 218 public void setBlocked( boolean blocked ) 219 { 220 this.blocked = blocked; 221 } //-- void setBlocked( boolean ) 222 223 /** 224 * Set the layout of the mirror repository. 225 * <br><b>Since</b>: Maven 3. 226 * 227 * @param layout a layout object. 228 */ 229 public void setLayout( String layout ) 230 { 231 this.layout = layout; 232 } //-- void setLayout( String ) 233 234 /** 235 * Set a repository id or (since Maven 2.0.9) an expression 236 * matching one or many repository ids to mirror, e.g., 237 * <code>central</code> or <code>*,!repo1</code>. 238 * <code>*</code> (since Maven 2.0.5), 239 * <code>external:*</code> (since Maven 2.0.9) and 240 * <code>external:http:*</code> (since Maven 3.8.0) have 241 * a special meaning: see <a 242 * href="/guides/mini/guide-mirror-settings.html">Mirror 243 * Settings</a> guide. 244 * 245 * @param mirrorOf a mirrorOf object. 246 */ 247 public void setMirrorOf( String mirrorOf ) 248 { 249 this.mirrorOf = mirrorOf; 250 } //-- void setMirrorOf( String ) 251 252 /** 253 * Set the layouts of repositories being mirrored. This value 254 * can be used to restrict the usage 255 * of the mirror to repositories with a matching 256 * layout (apart from a matching id). 257 * <br><b>Since</b>: Maven 3. 258 * 259 * @param mirrorOfLayouts a mirrorOfLayouts object. 260 */ 261 public void setMirrorOfLayouts( String mirrorOfLayouts ) 262 { 263 this.mirrorOfLayouts = mirrorOfLayouts; 264 } //-- void setMirrorOfLayouts( String ) 265 266 /** 267 * Set the optional name that describes the mirror. 268 * 269 * @param name a name object. 270 */ 271 public void setName( String name ) 272 { 273 this.name = name; 274 } //-- void setName( String ) 275 276 /** 277 * Set the URL of the mirror repository. 278 * 279 * @param url a url object. 280 */ 281 public void setUrl( String url ) 282 { 283 this.url = url; 284 } //-- void setUrl( String ) 285 286 287 288 289 public String toString() 290 { 291 StringBuilder sb = new StringBuilder( 128 ); 292 sb.append( "Mirror[" ); 293 sb.append( "id=" ).append( this.getId() ); 294 sb.append( ",mirrorOf=" ).append( mirrorOf ); 295 sb.append( ",url=" ).append( this.url ); 296 sb.append( ",name=" ).append( this.name ); 297 if ( isBlocked() ) 298 { 299 sb.append( ",blocked" ); 300 } 301 sb.append( "]" ); 302 return sb.toString(); 303 } 304 305 306 }