View Javadoc
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   */
19  package org.apache.maven.wrapper;
20  
21  import java.net.URI;
22  import java.nio.file.Path;
23  
24  /**
25   * Wrapper configuration.
26   */
27  public class WrapperConfiguration {
28      public static final String ALWAYS_UNPACK_ENV = "MAVEN_WRAPPER_ALWAYS_UNPACK";
29  
30      public static final String ALWAYS_DOWNLOAD_ENV = "MAVEN_WRAPPER_ALWAYS_DOWNLOAD";
31  
32      private boolean alwaysUnpack = Boolean.parseBoolean(System.getenv(ALWAYS_UNPACK_ENV));
33  
34      private boolean alwaysDownload = Boolean.parseBoolean(System.getenv(ALWAYS_DOWNLOAD_ENV));
35  
36      private URI distribution;
37  
38      private String distributionBase = PathAssembler.MAVEN_USER_HOME_STRING;
39  
40      private Path distributionPath = Installer.DEFAULT_DISTRIBUTION_PATH;
41  
42      private String zipBase = PathAssembler.MAVEN_USER_HOME_STRING;
43  
44      private Path zipPath = Installer.DEFAULT_DISTRIBUTION_PATH;
45  
46      private String distributionSha256Sum;
47  
48      public boolean isAlwaysDownload() {
49          return alwaysDownload;
50      }
51  
52      public void setAlwaysDownload(boolean alwaysDownload) {
53          this.alwaysDownload = alwaysDownload;
54      }
55  
56      public boolean isAlwaysUnpack() {
57          return alwaysUnpack;
58      }
59  
60      public void setAlwaysUnpack(boolean alwaysUnpack) {
61          this.alwaysUnpack = alwaysUnpack;
62      }
63  
64      public URI getDistribution() {
65          return distribution;
66      }
67  
68      public void setDistribution(URI distribution) {
69          this.distribution = distribution;
70      }
71  
72      public String getDistributionBase() {
73          return distributionBase;
74      }
75  
76      public void setDistributionBase(String distributionBase) {
77          this.distributionBase = distributionBase;
78      }
79  
80      public Path getDistributionPath() {
81          return distributionPath;
82      }
83  
84      public void setDistributionPath(Path distributionPath) {
85          this.distributionPath = distributionPath;
86      }
87  
88      public String getZipBase() {
89          return zipBase;
90      }
91  
92      public void setZipBase(String zipBase) {
93          this.zipBase = zipBase;
94      }
95  
96      public Path getZipPath() {
97          return zipPath;
98      }
99  
100     public void setZipPath(Path zipPath) {
101         this.zipPath = zipPath;
102     }
103 
104     public String getDistributionSha256Sum() {
105         return distributionSha256Sum;
106     }
107 
108     public void setDistributionSha256Sum(String distributionSha256Sum) {
109         this.distributionSha256Sum = distributionSha256Sum;
110     }
111 }