View Javadoc
1   package org.apache.maven.wrapper;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.net.URI;
23  import java.nio.file.Path;
24  
25  /**
26   * Wrapper configuration.
27   */
28  public class WrapperConfiguration
29  {
30      public static final String ALWAYS_UNPACK_ENV = "MAVEN_WRAPPER_ALWAYS_UNPACK";
31  
32      public static final String ALWAYS_DOWNLOAD_ENV = "MAVEN_WRAPPER_ALWAYS_DOWNLOAD";
33  
34      private boolean alwaysUnpack = Boolean.parseBoolean( System.getenv( ALWAYS_UNPACK_ENV ) );
35  
36      private boolean alwaysDownload = Boolean.parseBoolean( System.getenv( ALWAYS_DOWNLOAD_ENV ) );
37  
38      private URI distribution;
39  
40      private String distributionBase = PathAssembler.MAVEN_USER_HOME_STRING;
41  
42      private Path distributionPath = Installer.DEFAULT_DISTRIBUTION_PATH;
43  
44      private String zipBase = PathAssembler.MAVEN_USER_HOME_STRING;
45  
46      private Path zipPath = Installer.DEFAULT_DISTRIBUTION_PATH;
47  
48      public boolean isAlwaysDownload()
49      {
50          return alwaysDownload;
51      }
52  
53      public void setAlwaysDownload( boolean alwaysDownload )
54      {
55          this.alwaysDownload = alwaysDownload;
56      }
57  
58      public boolean isAlwaysUnpack()
59      {
60          return alwaysUnpack;
61      }
62  
63      public void setAlwaysUnpack( boolean alwaysUnpack )
64      {
65          this.alwaysUnpack = alwaysUnpack;
66      }
67  
68      public URI getDistribution()
69      {
70          return distribution;
71      }
72  
73      public void setDistribution( URI distribution )
74      {
75          this.distribution = distribution;
76      }
77  
78      public String getDistributionBase()
79      {
80          return distributionBase;
81      }
82  
83      public void setDistributionBase( String distributionBase )
84      {
85          this.distributionBase = distributionBase;
86      }
87  
88      public Path getDistributionPath()
89      {
90          return distributionPath;
91      }
92  
93      public void setDistributionPath( Path distributionPath )
94      {
95          this.distributionPath = distributionPath;
96      }
97  
98      public String getZipBase()
99      {
100         return zipBase;
101     }
102 
103     public void setZipBase( String zipBase )
104     {
105         this.zipBase = zipBase;
106     }
107 
108     public Path getZipPath()
109     {
110         return zipPath;
111     }
112 
113     public void setZipPath( Path zipPath )
114     {
115         this.zipPath = zipPath;
116     }
117 }