Class SourcesFileMarkerHandler
java.lang.Object
org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler
org.apache.maven.plugins.dependency.utils.markers.SourcesFileMarkerHandler
- All Implemented Interfaces:
MarkerHandler
- Author:
- Brian Fox
-
Field Summary
Fields inherited from class org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler
artifact, markerFilesDirectory
-
Constructor Summary
ConstructorDescriptionSourcesFileMarkerHandler
(File markerFilesDirectory) SourcesFileMarkerHandler
(org.apache.maven.artifact.Artifact artifact, File markerFilesDirectory, boolean isResolved) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deletes the file or directory denoted by this abstract pathname.Returns properly formatted Fileprotected File
getMarkerFile
(boolean res) Get MarkerFile, exposed for unit testing purposesboolean
isMarkerOlder
(org.apache.maven.artifact.Artifact theArtifact) boolean
Tests whether the file or directory denoted by this abstract pathname exists.boolean
void
void
setResolved
(boolean isResolved) Methods inherited from class org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler
getArtifact, getMarkerFilesDirectory, setArtifact, setMarkerFilesDirectory
-
Constructor Details
-
SourcesFileMarkerHandler
- Parameters:
markerFilesDirectory
- the marker files directory.
-
SourcesFileMarkerHandler
public SourcesFileMarkerHandler(org.apache.maven.artifact.Artifact artifact, File markerFilesDirectory, boolean isResolved) - Parameters:
artifact
-Artifact
markerFilesDirectory
- marker files directory.isResolved
- true/false.
-
-
Method Details
-
getMarkerFile
Returns properly formatted File- Overrides:
getMarkerFile
in classDefaultFileMarkerHandler
- Returns:
- File object for marker. The file is not guaranteed to exist.
-
getMarkerFile
Get MarkerFile, exposed for unit testing purposes- Parameters:
res
- resolved or not.- Returns:
- marker file for this artifact.
-
isMarkerSet
public boolean isMarkerSet() throws org.apache.maven.plugin.MojoExecutionExceptionTests whether the file or directory denoted by this abstract pathname exists.- Specified by:
isMarkerSet
in interfaceMarkerHandler
- Overrides:
isMarkerSet
in classDefaultFileMarkerHandler
- Returns:
true
if and only if the file or directory denoted by this abstract pathname exists;false
otherwise- Throws:
org.apache.maven.plugin.MojoExecutionException
- If a security manager exists and its
method denies read access to the file or directorySecurityManager.checkRead(java.lang.String)
-
isMarkerOlder
public boolean isMarkerOlder(org.apache.maven.artifact.Artifact theArtifact) throws org.apache.maven.plugin.MojoExecutionException - Specified by:
isMarkerOlder
in interfaceMarkerHandler
- Overrides:
isMarkerOlder
in classDefaultFileMarkerHandler
- Parameters:
theArtifact
-Artifact
- Returns:
- true/false.
- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of an error.
-
setMarker
public void setMarker() throws org.apache.maven.plugin.MojoExecutionException- Specified by:
setMarker
in interfaceMarkerHandler
- Overrides:
setMarker
in classDefaultFileMarkerHandler
- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of an error.
-
clearMarker
public boolean clearMarker() throws org.apache.maven.plugin.MojoExecutionExceptionDeletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted.- Specified by:
clearMarker
in interfaceMarkerHandler
- Overrides:
clearMarker
in classDefaultFileMarkerHandler
- Returns:
true
if and only if the file or directory is successfully deleted;false
otherwise- Throws:
SecurityException
- If a security manager exists and its
method denies delete access to the fileSecurityManager.checkDelete(java.lang.String)
org.apache.maven.plugin.MojoExecutionException
- in case of an error.
-
isResolved
public boolean isResolved()- Returns:
- Returns the resolved.
-
setResolved
public void setResolved(boolean isResolved) - Parameters:
isResolved
- The resolved to set.
-