Class DefaultMavenFileFilter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copyFile​(java.io.File from, java.io.File to, boolean filtering, java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers, java.lang.String encoding)
      void copyFile​(java.io.File from, java.io.File to, boolean filtering, java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers, java.lang.String encoding, boolean overwrite)
      void copyFile​(java.io.File from, java.io.File to, boolean filtering, org.apache.maven.project.MavenProject mavenProject, java.util.List<java.lang.String> filters, boolean escapedBackslashesInFilePath, java.lang.String encoding, org.apache.maven.execution.MavenSession mavenSession)
      Will copy a file with some filtering using defaultFilterWrappers.
      void copyFile​(MavenFileFilterRequest mavenFileFilterRequest)
      private void filterFile​(java.io.File from, java.io.File to, java.lang.String encoding, java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> wrappers)  
      private java.io.Reader getFileReader​(java.lang.String encoding, java.io.File from)  
      private java.io.Writer getFileWriter​(java.lang.String encoding, java.io.File to)  
      • Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled

        enableLogging, getLogger, setupLogger, setupLogger, setupLogger
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buildContext

        @Requirement
        private org.sonatype.plexus.build.incremental.BuildContext buildContext
    • Constructor Detail

      • DefaultMavenFileFilter

        public DefaultMavenFileFilter()
    • Method Detail

      • copyFile

        public void copyFile​(java.io.File from,
                             java.io.File to,
                             boolean filtering,
                             org.apache.maven.project.MavenProject mavenProject,
                             java.util.List<java.lang.String> filters,
                             boolean escapedBackslashesInFilePath,
                             java.lang.String encoding,
                             org.apache.maven.execution.MavenSession mavenSession)
                      throws MavenFilteringException
        Will copy a file with some filtering using defaultFilterWrappers.
        Specified by:
        copyFile in interface MavenFileFilter
        Parameters:
        from - file to copy/filter
        to - destination file
        filtering - enable or not filtering
        mavenProject - MavenProject
        filters - List of String which are path to a Property file
        escapedBackslashesInFilePath - escape backslashes in file path.
        encoding - The encoding which is used during the filtering process.
        mavenSession - MavenSession
        Throws:
        MavenFilteringException - in case of failure.
        See Also:
        #getDefaultFilterWrappers(MavenProject, List, boolean, MavenSession)
      • copyFile

        public void copyFile​(java.io.File from,
                             java.io.File to,
                             boolean filtering,
                             java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers,
                             java.lang.String encoding)
                      throws MavenFilteringException
        Specified by:
        copyFile in interface MavenFileFilter
        Parameters:
        from - The source file
        to - The target file
        filtering - true to apply filtering
        filterWrappers - List of FileUtils.FilterWrapper
        encoding - The encoding used during the filtering.
        Throws:
        MavenFilteringException - In case of an error.
      • copyFile

        public void copyFile​(java.io.File from,
                             java.io.File to,
                             boolean filtering,
                             java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> filterWrappers,
                             java.lang.String encoding,
                             boolean overwrite)
                      throws MavenFilteringException
        Specified by:
        copyFile in interface MavenFileFilter
        Parameters:
        from - The source file
        to - The destination file
        filtering - true to apply filtering
        filterWrappers - The filters to be applied.
        encoding - The encoding to use
        overwrite - Overwrite to file ?
        Throws:
        MavenFilteringException - In case of an error.
      • filterFile

        private void filterFile​(@Nonnull
                                java.io.File from,
                                @Nonnull
                                java.io.File to,
                                @Nullable
                                java.lang.String encoding,
                                @Nullable
                                java.util.List<org.apache.maven.shared.utils.io.FileUtils.FilterWrapper> wrappers)
                         throws java.io.IOException,
                                MavenFilteringException
        Throws:
        java.io.IOException
        MavenFilteringException
      • getFileWriter

        private java.io.Writer getFileWriter​(java.lang.String encoding,
                                             java.io.File to)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getFileReader

        private java.io.Reader getFileReader​(java.lang.String encoding,
                                             java.io.File from)
                                      throws java.io.FileNotFoundException,
                                             java.io.UnsupportedEncodingException
        Throws:
        java.io.FileNotFoundException
        java.io.UnsupportedEncodingException