You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2007/07/06 04:52:28 UTC
svn commit: r553706 -
/maven/shared/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java
Author: brianf
Date: Thu Jul 5 19:52:27 2007
New Revision: 553706
URL: http://svn.apache.org/viewvc?view=rev&rev=553706
Log:
added new constructor
Modified:
maven/shared/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java
Modified: maven/shared/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java?view=diff&rev=553706&r1=553705&r2=553706
==============================================================================
--- maven/shared/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java (original)
+++ maven/shared/trunk/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/ArtifactStubFactory.java Thu Jul 5 19:52:27 2007
@@ -64,6 +64,21 @@
ArchiverManager archiverManager;
+ /**
+ * Default constructor. This should be used only if real files aren't needed...just the artifact objects
+ *
+ */
+ public ArtifactStubFactory()
+ {
+ this.workingDir = null;
+ this.createFiles = false;
+ }
+
+ /**
+ * This constructor is to be used if files are needed and to set a working dir
+ * @param workingDir
+ * @param createFiles
+ */
public ArtifactStubFactory( File workingDir, boolean createFiles )
{
this.workingDir = new File( workingDir, "localTestRepo" );
@@ -123,6 +138,11 @@
public void setArtifactFile( Artifact artifact )
throws IOException
{
+ if (this.workingDir == null )
+ {
+ throw new IllegalArgumentException("The workingDir must be set if createFiles is true.");
+ }
+
String fileName = getFormattedFileName( artifact, false );
File theFile = new File( this.workingDir, fileName );