diff --git a/src/main/java/org/apache/maven/shared/verifier/Verifier.java b/src/main/java/org/apache/maven/shared/verifier/Verifier.java index 2229bd1..a478eec 100644 --- a/src/main/java/org/apache/maven/shared/verifier/Verifier.java +++ b/src/main/java/org/apache/maven/shared/verifier/Verifier.java @@ -950,6 +950,11 @@ public void writeFile( String path, String contents ) /** * Filters a text file by replacing some user-defined tokens. + * This method is equivalent to: + * + *
+ * filterFile( srcPath, dstPath, fileEncoding, verifier.newDefaultFilterMap() ) + ** * @param srcPath The path to the input file, relative to the base directory, must not be *
null.
@@ -957,21 +962,39 @@ public void writeFile( String path, String contents )
* input file, must not be null.
* @param fileEncoding The file encoding to use, may be null or empty to use the platform's default
* encoding.
- * @param filterProperties The mapping from tokens to replacement values, must not be null.
+ * @return The path to the filtered output file, never null.
+ * @throws IOException If the file could not be filtered.
+ * @since 2.0
+ */
+ public File filterFile( String srcPath, String dstPath, String fileEncoding )
+ throws IOException
+ {
+ return filterFile( srcPath, dstPath, fileEncoding, newDefaultFilterMap() );
+ }
+
+ /**
+ * Filters a text file by replacing some user-defined tokens.
+ *
+ * @param srcPath The path to the input file, relative to the base directory, must not be
+ * null.
+ * @param dstPath The path to the output file, relative to the base directory and possibly equal to the
+ * input file, must not be null.
+ * @param fileEncoding The file encoding to use, may be null or empty to use the platform's default
+ * encoding.
+ * @param filterMap The mapping from tokens to replacement values, must not be null.
* @return The path to the filtered output file, never null.
* @throws IOException If the file could not be filtered.
* @since 1.2
*/
- public File filterFile( String srcPath, String dstPath, String fileEncoding, Mapnull.
* @since 1.2
+ * @deprecated use {@link #newDefaultFilterMap()}
*/
+ @Deprecated
public Properties newDefaultFilterProperties()
{
Properties filterProperties = new Properties();
+ filterProperties.putAll( newDefaultFilterMap() );
+ return filterProperties;
+ }
+
+ /**
+ * Gets a new copy of the default filter map. These default filter map, contains the tokens "@basedir@" and
+ * "@baseurl@" to the test's base directory and its base file: URL, respectively.
+ *
+ * @return The (modifiable) map with the default filter map, never null.
+ * @since 2.0
+ */
+ public Map