org.apache.maven.plugin.dependency.utils.markers
Class DefaultFileMarkerHandler

java.lang.Object
  extended by org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler
All Implemented Interfaces:
MarkerHandler
Direct Known Subclasses:
SourcesFileMarkerHandler, UnpackFileMarkerHandler

public class DefaultFileMarkerHandler
extends Object
implements MarkerHandler

Version:
$Id: DefaultFileMarkerHandler.java 1368122 2012-08-01 16:54:53Z olamy $
Author:
Brian Fox

Field Summary
protected  Artifact artifact
           
protected  File markerFilesDirectory
           
 
Constructor Summary
DefaultFileMarkerHandler(Artifact theArtifact, File theMarkerFilesDirectory)
           
DefaultFileMarkerHandler(File theMarkerFilesDirectory)
           
 
Method Summary
 boolean clearMarker()
          Deletes the file or directory denoted by this abstract pathname.
 Artifact getArtifact()
           
protected  File getMarkerFile()
          Returns properly formatted File
 File getMarkerFilesDirectory()
           
 boolean isMarkerOlder(Artifact artifact1)
           
 boolean isMarkerSet()
          Tests whether the file or directory denoted by this abstract pathname exists.
 void setArtifact(Artifact artifact)
           
 void setMarker()
           
 void setMarkerFilesDirectory(File markerFilesDirectory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

artifact

protected Artifact artifact

markerFilesDirectory

protected File markerFilesDirectory
Constructor Detail

DefaultFileMarkerHandler

public DefaultFileMarkerHandler(File theMarkerFilesDirectory)

DefaultFileMarkerHandler

public DefaultFileMarkerHandler(Artifact theArtifact,
                                File theMarkerFilesDirectory)
Method Detail

getMarkerFile

protected File getMarkerFile()
Returns properly formatted File

Returns:
File object for marker. The file is not guaranteed to exist.

isMarkerSet

public boolean isMarkerSet()
                    throws MojoExecutionException
Tests whether the file or directory denoted by this abstract pathname exists.

Specified by:
isMarkerSet in interface MarkerHandler
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 SecurityManager.checkRead(java.lang.String) method denies read access to the file or directory
MojoExecutionException

isMarkerOlder

public boolean isMarkerOlder(Artifact artifact1)
                      throws MojoExecutionException
Specified by:
isMarkerOlder in interface MarkerHandler
Throws:
MojoExecutionException

setMarker

public void setMarker()
               throws MojoExecutionException
Specified by:
setMarker in interface MarkerHandler
Throws:
MojoExecutionException

clearMarker

public boolean clearMarker()
                    throws MojoExecutionException
Deletes 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 interface MarkerHandler
Returns:
true if and only if the file or directory is successfully deleted; false otherwise
Throws:
SecurityException - If a security manager exists and its SecurityManager.checkDelete(java.lang.String) method denies delete access to the file
MojoExecutionException

getArtifact

public Artifact getArtifact()
Returns:
Returns the artifact.

setArtifact

public void setArtifact(Artifact artifact)
Specified by:
setArtifact in interface MarkerHandler
Parameters:
artifact - The artifact to set.

getMarkerFilesDirectory

public File getMarkerFilesDirectory()
Returns:
Returns the markerFilesDirectory.

setMarkerFilesDirectory

public void setMarkerFilesDirectory(File markerFilesDirectory)
Parameters:
markerFilesDirectory - The markerFilesDirectory to set.


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.