Class FileModelSource

java.lang.Object
org.apache.maven.building.FileSource
org.apache.maven.model.building.FileModelSource
All Implemented Interfaces:
Source, ModelSource, ModelSource2, ModelSource3

public class FileModelSource extends FileSource implements ModelSource3
Wraps an ordinary File as a model source.
  • Constructor Details

    • FileModelSource

      @Deprecated public FileModelSource(File pomFile)
      Deprecated.
      Creates a new model source backed by the specified file.
      Parameters:
      pomFile - The POM file, must not be null.
    • FileModelSource

      public FileModelSource(Path pomPath)
      Creates a new model source backed by the specified file.
      Parameters:
      pomPath - The POM file, must not be null.
      Since:
      4.0.0
  • Method Details

    • getPomFile

      @Deprecated public File getPomFile()
      Deprecated.
      Returns:
      the file of this source
    • getRelatedSource

      public ModelSource3 getRelatedSource(ModelLocator locator, String relPath)
      Description copied from interface: ModelSource3
      Returns model source identified by a path relative to this model source POM. Implementation MUST accept relPath parameter values that
      • use either / or \ file path separator
      • have .. parent directory references
      • point either at file or directory
      If the given path points at a directory, the provided ModelLocator will be used to find the POM file, else if no locator is provided, a file named 'pom.xml' needs to be used by the requested model source.
      Specified by:
      getRelatedSource in interface ModelSource3
      Parameters:
      locator - locator used to locate the pom file
      relPath - path of the requested model source relative to this model source POM
      Returns:
      related model source or null if no such model source
    • getLocationURI

      public URI getLocationURI()
      Description copied from interface: ModelSource2
      Returns location of the POM, never null.
      Specified by:
      getLocationURI in interface ModelSource2
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class FileSource
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class FileSource