Class DefaultMavenResourcesFiltering
java.lang.Object
org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
- All Implemented Interfaces:
MavenResourcesFiltering
@Singleton
@Named
public class DefaultMavenResourcesFiltering
extends Object
implements MavenResourcesFiltering
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.sonatype.plexus.build.incremental.BuildContextprivate static final String[]private static final String[]private static final org.slf4j.Loggerprivate final MavenFileFilter -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMavenResourcesFiltering(MavenFileFilter mavenFileFilter, org.sonatype.plexus.build.incremental.BuildContext buildContext) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcopyDirectoryLayout(File sourceDirectory, File destinationDirectory, org.codehaus.plexus.util.Scanner scanner) booleanfilteredFileExtension(String fileName, List<String> userNonFilteredFileExtensions) private StringfilterFileName(String name, List<FilterWrapper> wrappers) voidfilterResources(MavenResourcesExecution mavenResourcesExecution) return the List of the non filtered extensions (jpg,jpeg,gif,bmp,png,ico)private FilegetDestinationFile(File outputDirectory, String targetPath, String name, MavenResourcesExecution mavenResourcesExecution) (package private) static StringgetEncoding(File file, String encoding, String propertiesEncoding) Get the encoding to use when filtering the specified file.private static StringgetExtension(String fileName) private Stringprivate voidhandleDefaultFilterWrappers(MavenResourcesExecution mavenResourcesExecution) (package private) static booleanisPropertiesFile(File file) Determine whether a file is a properties file or not.private String[]setupScanner(org.apache.maven.model.Resource resource, org.codehaus.plexus.util.Scanner scanner, boolean addDefaultExcludes)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
EMPTY_STRING_ARRAY
-
DEFAULT_INCLUDES
-
defaultNonFilteredFileExtensions
-
mavenFileFilter
-
buildContext
private final org.sonatype.plexus.build.incremental.BuildContext buildContext
-
-
Constructor Details
-
Method Details
-
filteredFileExtension
- Specified by:
filteredFileExtensionin interfaceMavenResourcesFiltering- Parameters:
fileName- the file nameuserNonFilteredFileExtensions- an extra list of file extensions- Returns:
- true if filtering can be applied to the file (means extensions.lowerCase is in the default List or in the user defined extension List)
-
getExtension
-
getDefaultNonFilteredFileExtensions
Description copied from interface:MavenResourcesFilteringreturn the List of the non filtered extensions (jpg,jpeg,gif,bmp,png,ico)- Specified by:
getDefaultNonFilteredFileExtensionsin interfaceMavenResourcesFiltering- Returns:
ListofString
-
getEncoding
Get the encoding to use when filtering the specified file. Properties files can be configured to use a different encoding than regular files.- Parameters:
file- The file to checkencoding- The encoding to use for regular filespropertiesEncoding- The encoding to use for properties files- Returns:
- The encoding to use when filtering the specified file
- Since:
- 3.2.0
-
isPropertiesFile
Determine whether a file is a properties file or not.- Parameters:
file- The file to check- Returns:
trueif the file name has an extension of "properties", otherwisefalse- Since:
- 3.2.0
-
setupScanner
private String[] setupScanner(org.apache.maven.model.Resource resource, org.codehaus.plexus.util.Scanner scanner, boolean addDefaultExcludes) -
copyDirectoryLayout
private void copyDirectoryLayout(File sourceDirectory, File destinationDirectory, org.codehaus.plexus.util.Scanner scanner) throws IOException - Throws:
IOException
-
filterFileName
private String filterFileName(String name, List<FilterWrapper> wrappers) throws MavenFilteringException - Throws:
MavenFilteringException
-