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.shared.filtering;
20  
21  import java.io.Reader;
22  import java.util.List;
23  
24  import org.apache.maven.execution.MavenSession;
25  import org.apache.maven.project.MavenProject;
26  
27  /**
28   * @author Olivier Lamy
29   * @author Kristian Rosenvold
30   * @since 1.3
31   */
32  public interface MavenReaderFilter extends DefaultFilterInfo {
33      /**
34       * Provides a new reader that applies filtering using defaultFilterWrappers.
35       *
36       * @param from the source reader
37       * @param filtering enable or not filtering
38       * @param mavenProject {@link MavenProject}
39       * @param mavenSession {@link MavenSession}
40       * @param filters {@link java.util.List} of String which are path to a Property file
41       * @param escapedBackslashesInFilePath escape backslashes in file path.
42       * @return an input stream that applies the filter
43       * @throws org.apache.maven.shared.filtering.MavenFilteringException in case of failure.
44       * @see #getDefaultFilterWrappers(org.apache.maven.project.MavenProject, java.util.List, boolean,
45       *      org.apache.maven.execution.MavenSession, org.apache.maven.shared.filtering.MavenResourcesExecution)
46       */
47      Reader filter(
48              Reader from,
49              boolean filtering,
50              MavenProject mavenProject,
51              List<String> filters,
52              boolean escapedBackslashesInFilePath,
53              MavenSession mavenSession)
54              throws MavenFilteringException;
55  
56      /**
57       * Provides a new reader that applies filtering using defaultFilterWrappers.
58       *
59       * @param mavenFileFilterRequest The filter request
60       * @throws org.apache.maven.shared.filtering.MavenFilteringException in case of failure.
61       * @return an input stream that applies the filter
62       * @since 1.0-beta-3
63       */
64      Reader filter(MavenReaderFilterRequest mavenFileFilterRequest) throws MavenFilteringException;
65  
66      /**
67       * Provides a new reader that applies filtering using defaultFilterWrappers.
68       *
69       * @param from the source reader
70       * @param filtering true to apply filtering
71       * @param filterWrappers {@link java.util.List} of FileUtils.FilterWrapper
72       * @return an input stream that applies the filter
73       */
74      Reader filter(Reader from, boolean filtering, List<FilterWrapper> filterWrappers);
75  }