Class DefaultFileMarkerHandler
java.lang.Object
org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler
- All Implemented Interfaces:
MarkerHandler
- Direct Known Subclasses:
SourcesFileMarkerHandler
,UnpackFileMarkerHandler
- Author:
- Brian Fox
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.maven.artifact.Artifact
The artifact.protected File
The marker directory. -
Constructor Summary
ConstructorDescriptionDefaultFileMarkerHandler
(File theMarkerFilesDirectory) DefaultFileMarkerHandler
(org.apache.maven.artifact.Artifact theArtifact, File theMarkerFilesDirectory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deletes the file or directory denoted by this abstract pathname.org.apache.maven.artifact.Artifact
protected File
Returns properly formatted Fileboolean
isMarkerOlder
(org.apache.maven.artifact.Artifact artifact1) boolean
Tests whether the file or directory denoted by this abstract pathname exists.void
setArtifact
(org.apache.maven.artifact.Artifact artifact) void
void
setMarkerFilesDirectory
(File markerFilesDirectory)
-
Field Details
-
artifact
protected org.apache.maven.artifact.Artifact artifactThe artifact. -
markerFilesDirectory
The marker directory.
-
-
Constructor Details
-
DefaultFileMarkerHandler
- Parameters:
theMarkerFilesDirectory
- The marker directory.
-
DefaultFileMarkerHandler
public DefaultFileMarkerHandler(org.apache.maven.artifact.Artifact theArtifact, File theMarkerFilesDirectory) - Parameters:
theArtifact
-Artifact
theMarkerFilesDirectory
- The marker directory.
-
-
Method Details
-
getMarkerFile
Returns properly formatted File- Returns:
- File object for marker. The file is not guaranteed to exist.
-
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
- Returns:
true
if and only if the file or directory denoted by this abstract pathname exists;false
otherwise- Throws:
SecurityException
- If a security manager exists and its
method denies read access to the file or directorySecurityManager.checkRead(java.lang.String)
org.apache.maven.plugin.MojoExecutionException
- in case of an error.
-
isMarkerOlder
public boolean isMarkerOlder(org.apache.maven.artifact.Artifact artifact1) throws org.apache.maven.plugin.MojoExecutionException - Specified by:
isMarkerOlder
in interfaceMarkerHandler
- Parameters:
artifact1
-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
- 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
- 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.
-
getArtifact
public org.apache.maven.artifact.Artifact getArtifact()- Returns:
- Returns the artifact.
-
setArtifact
public void setArtifact(org.apache.maven.artifact.Artifact artifact) - Specified by:
setArtifact
in interfaceMarkerHandler
- Parameters:
artifact
- The artifact to set.
-
getMarkerFilesDirectory
- Returns:
- Returns the markerFilesDirectory.
-
setMarkerFilesDirectory
- Parameters:
markerFilesDirectory
- The markerFilesDirectory to set.
-