1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.rwx.maven.asciidoc.services.impl;
18
19 import net.rwx.maven.asciidoc.backends.Backend;
20 import net.rwx.maven.asciidoc.configuration.Document;
21 import net.rwx.maven.asciidoc.services.RootService;
22 import org.apache.commons.io.FilenameUtils;
23 import org.apache.maven.plugin.logging.Log;
24
25
26
27
28
29 public abstract class RootServiceImpl implements RootService {
30
31 private Log logger;
32 private String outputPath;
33
34 @Override
35 public void setLogger(Log logger) {
36 this.logger = logger;
37 }
38
39 public Log getLogger() {
40 return logger;
41 }
42
43 protected abstract void setOuputPath( String inputPath, Backend backend );
44
45 protected void setOutputPath( String inputPath, String extension ) {
46 StringBuilder builder = new StringBuilder();
47 builder.append( FilenameUtils.removeExtension( inputPath ) );
48 builder.append( extension );
49
50 setOutputPath( builder.toString() );
51 }
52
53 protected void setOutputPath( String outputPath ) {
54 this.outputPath = outputPath;
55 }
56
57 @Override
58 public String getOuputPath() {
59 return outputPath;
60 }
61 }