Class DefaultFileMarkerHandler
- java.lang.Object
-
- org.apache.maven.plugins.dependency.utils.markers.DefaultFileMarkerHandler
-
- All Implemented Interfaces:
MarkerHandler
- Direct Known Subclasses:
SourcesFileMarkerHandler,UnpackFileMarkerHandler
public class DefaultFileMarkerHandler extends java.lang.Object implements MarkerHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.maven.artifact.ArtifactartifactThe artifact.protected java.io.FilemarkerFilesDirectoryThe marker directory.
-
Constructor Summary
Constructors Constructor Description DefaultFileMarkerHandler(java.io.File theMarkerFilesDirectory)DefaultFileMarkerHandler(org.apache.maven.artifact.Artifact theArtifact, java.io.File theMarkerFilesDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclearMarker()Deletes the file or directory denoted by this abstract pathname.org.apache.maven.artifact.ArtifactgetArtifact()protected java.io.FilegetMarkerFile()Returns properly formatted Filejava.io.FilegetMarkerFilesDirectory()booleanisMarkerOlder(org.apache.maven.artifact.Artifact artifact1)booleanisMarkerSet()Tests whether the file or directory denoted by this abstract pathname exists.voidsetArtifact(org.apache.maven.artifact.Artifact artifact)voidsetMarker()voidsetMarkerFilesDirectory(java.io.File markerFilesDirectory)
-
-
-
Constructor Detail
-
DefaultFileMarkerHandler
public DefaultFileMarkerHandler(java.io.File theMarkerFilesDirectory)
- Parameters:
theMarkerFilesDirectory- The marker directory.
-
DefaultFileMarkerHandler
public DefaultFileMarkerHandler(org.apache.maven.artifact.Artifact theArtifact, java.io.File theMarkerFilesDirectory)- Parameters:
theArtifact-ArtifacttheMarkerFilesDirectory- The marker directory.
-
-
Method Detail
-
getMarkerFile
protected java.io.File 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:
isMarkerSetin interfaceMarkerHandler- Returns:
trueif and only if the file or directory denoted by this abstract pathname exists;falseotherwise- Throws:
java.lang.SecurityException- If a security manager exists and itsmethod 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:
isMarkerOlderin 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:
setMarkerin 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:
clearMarkerin interfaceMarkerHandler- Returns:
trueif and only if the file or directory is successfully deleted;falseotherwise- Throws:
java.lang.SecurityException- If a security manager exists and itsmethod 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:
setArtifactin interfaceMarkerHandler- Parameters:
artifact- The artifact to set.
-
getMarkerFilesDirectory
public java.io.File getMarkerFilesDirectory()
- Returns:
- Returns the markerFilesDirectory.
-
setMarkerFilesDirectory
public void setMarkerFilesDirectory(java.io.File markerFilesDirectory)
- Parameters:
markerFilesDirectory- The markerFilesDirectory to set.
-
-