01: package org.andromda.maven.plugin.andromdapp.eclipse;
02:
03: import java.io.File;
04:
05: import org.andromda.core.common.ResourceUtils;
06: import org.apache.maven.plugin.logging.Log;
07: import org.apache.maven.project.MavenProject;
08:
09: /**
10: * Provides Eclipse configuration file writing
11: * capabilities.
12: *
13: * @author Chad Brandon
14: */
15: public abstract class EclipseWriter {
16: protected Log logger;
17:
18: protected MavenProject project;
19:
20: public EclipseWriter(final MavenProject project, final Log logger) {
21: this .project = project;
22: this .logger = logger;
23: }
24:
25: /**
26: * Gets the project relative file given the <code>name</code> of the file.
27: *
28: * @param name the name of the file.
29: * @return the actual file instance.
30: */
31: protected File getFile(final String name) {
32: final String rootDirectory = ResourceUtils
33: .normalizePath(this .project.getBasedir().toString());
34: final File file = new File(rootDirectory, name);
35: return file;
36: }
37:
38: }
|