Package org.apache.maven.model.building
Class FileModelSource
java.lang.Object
org.apache.maven.building.FileSource
org.apache.maven.model.building.FileModelSource
- All Implemented Interfaces:
Source
,ModelSource
,ModelSource2
,ModelSource3
Wraps an ordinary
File
as a model source.-
Constructor Summary
ConstructorDescriptionFileModelSource
(File pomFile) Deprecated.FileModelSource
(Path pomPath) Creates a new model source backed by the specified file. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns location of the POM, nevernull
.Deprecated.instead useFileSource.getFile()
getRelatedSource
(ModelLocator locator, String relPath) Returns model source identified by a path relative to this model source POM.int
hashCode()
Methods inherited from class org.apache.maven.building.FileSource
getFile, getInputStream, getLocation, getPath, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.maven.model.building.ModelSource3
getRelatedSource
Methods inherited from interface org.apache.maven.building.Source
getInputStream, getLocation
-
Constructor Details
-
FileModelSource
Deprecated.UseFileModelSource(Path)
instead.Creates a new model source backed by the specified file.- Parameters:
pomFile
- The POM file, must not benull
.
-
FileModelSource
Creates a new model source backed by the specified file.- Parameters:
pomPath
- The POM file, must not benull
.- Since:
- 4.0.0
-
-
Method Details
-
getPomFile
Deprecated.instead useFileSource.getFile()
- Returns:
- the file of this source
-
getRelatedSource
Description copied from interface:ModelSource3
Returns model source identified by a path relative to this model source POM. Implementation MUST acceptrelPath
parameter values that- use either / or \ file path separator
- have .. parent directory references
- point either at file or directory
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 interfaceModelSource3
- Parameters:
locator
- locator used to locate the pom filerelPath
- path of the requested model source relative to this model source POM- Returns:
- related model source or
null
if no such model source
-
getLocationURI
Description copied from interface:ModelSource2
Returns location of the POM, nevernull
.- Specified by:
getLocationURI
in interfaceModelSource2
-
equals
- Overrides:
equals
in classFileSource
-
hashCode
public int hashCode()- Overrides:
hashCode
in classFileSource
-
FileModelSource(Path)
instead.