1 package org.codehaus.mojo.axistools.axis;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.artifact.factory.ArtifactFactory;
23 import org.apache.maven.artifact.repository.ArtifactRepository;
24 import org.apache.maven.plugin.logging.Log;
25 import org.apache.maven.project.MavenProject;
26
27 import java.io.File;
28 import java.util.Iterator;
29 import java.util.List;
30
31
32
33
34
35
36
37
38 public abstract class AbstractAxisPlugin
39 {
40 protected File sourceDirectory;
41
42 protected File outputDirectory;
43
44 protected File timestampDirectory;
45
46 protected int staleMillis;
47
48 protected MavenProject project;
49
50 protected ArtifactRepository localRepository;
51
52 protected ArtifactFactory artifactFactory;
53
54 protected List pluginArtifacts;
55
56 protected Log log;
57
58
59
60
61
62
63
64
65
66
67
68
69 protected String createSafeFileName( String aName )
70 {
71 String fileName = aName.replaceAll( "[^\\p{Alnum}\\.]", "-" );
72
73 if ( !fileName.endsWith( ".wsdl" ) )
74 {
75 fileName += ".wsdl";
76 }
77 return fileName;
78 }
79
80
81
82
83 protected String listToCommaDelimitedString( List list )
84 {
85 StringBuffer strbuf = new StringBuffer();
86
87 if ( list != null )
88 {
89 for ( Iterator i = list.iterator(); i.hasNext(); )
90 {
91 strbuf.append( (String) i.next() );
92 if ( i.hasNext() )
93 {
94 strbuf.append( "," );
95 }
96 }
97 }
98 return strbuf.toString();
99 }
100
101 protected Log getLog()
102 {
103 return log;
104 }
105
106 public void setLog( Log log )
107 {
108 this.log = log;
109 }
110
111 public void setSourceDirectory( File sourceDirectory )
112 {
113 this.sourceDirectory = sourceDirectory;
114 }
115
116 public void setOutputDirectory( File outputDirectory )
117 {
118 this.outputDirectory = outputDirectory;
119 }
120
121 public void setTimestampDirectory( File timestampDirectory )
122 {
123 this.timestampDirectory = timestampDirectory;
124 }
125
126 public void setStaleMillis( int staleMillis )
127 {
128 this.staleMillis = staleMillis;
129 }
130
131 public void setProject( MavenProject project )
132 {
133 this.project = project;
134 }
135
136 public void setLocalRepository( ArtifactRepository localRepository )
137 {
138 this.localRepository = localRepository;
139 }
140
141 public void setArtifactFactory( ArtifactFactory artifactFactory )
142 {
143 this.artifactFactory = artifactFactory;
144 }
145
146 public void setPluginArtifacts( List pluginArtifacts )
147 {
148 this.pluginArtifacts = pluginArtifacts;
149 }
150
151 }