1 package org.apache.maven.shared.filtering;
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.io.File;
23 import java.util.List;
24 import java.util.Properties;
25
26 import org.apache.maven.execution.MavenSession;
27 import org.apache.maven.project.MavenProject;
28
29 /**
30 * @author Olivier Lamy
31 * @since 1.0-beta-3
32 */
33 public class MavenFileFilterRequest
34 extends AbstractMavenFilteringRequest
35 {
36
37 private File from;
38
39 private File to;
40
41 private boolean filtering;
42
43 private String encoding;
44
45 /**
46 * The constructor.
47 */
48 public MavenFileFilterRequest()
49 {
50 // nothing
51 }
52
53 /**
54 * @param from The request from where.
55 * @param to The request to where
56 * @param filtering Filtering yes {@code true} or no {@code false}
57 * @param mavenProject The Maven Project.
58 * @param filters The list of given filters.
59 * @param escapedBackslashesInFilePath Escape back slashes in file path.
60 * @param encoding The used encoding during the filtering.
61 * @param mavenSession The Maven Session.
62 * @param additionalProperties Supplemental properties.
63 */
64 public MavenFileFilterRequest( File from, File to, boolean filtering, MavenProject mavenProject,
65 List<String> filters, boolean escapedBackslashesInFilePath, String encoding,
66 MavenSession mavenSession, Properties additionalProperties )
67 {
68 super( mavenProject, filters, mavenSession );
69 this.encoding = encoding;
70 this.from = from;
71 this.to = to;
72 this.filtering = filtering;
73 setAdditionalProperties( additionalProperties );
74 setEscapeWindowsPaths( escapedBackslashesInFilePath );
75 }
76
77 /**
78 * Return the encoding.
79 *
80 * @return Current encoding.
81 */
82 public String getEncoding()
83 {
84 return encoding;
85 }
86
87 /**
88 * Set the value for encoding.
89 *
90 * @param encoding Give the new value for encoding.
91 */
92 public void setEncoding( String encoding )
93 {
94 this.encoding = encoding;
95 }
96
97 /**
98 * @return to filter from.
99 */
100 public File getFrom()
101 {
102 return from;
103 }
104
105 /**
106 * @param from set filter from.
107 */
108 public void setFrom( File from )
109 {
110 this.from = from;
111 }
112
113 /**
114 * @return The filter to
115 */
116 public File getTo()
117 {
118 return to;
119 }
120
121 /**
122 * @param to Set the target.
123 */
124 public void setTo( File to )
125 {
126 this.to = to;
127 }
128
129 /**
130 * @return if we are filtering yes {@code true} no {@code false}
131 */
132 public boolean isFiltering()
133 {
134 return filtering;
135 }
136
137 /**
138 * @param filtering set filtering yes / no.
139 */
140 public void setFiltering( boolean filtering )
141 {
142 this.filtering = filtering;
143 }
144
145 }