1 package org.apache.maven.toolchain.io;
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.toolchain.model.PersistedToolchains;
23 import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Writer;
24
25 import javax.inject.Named;
26 import javax.inject.Singleton;
27 import java.io.IOException;
28 import java.io.Writer;
29 import java.util.Map;
30 import java.util.Objects;
31
32
33
34
35
36
37
38 @Named
39 @Singleton
40 public class DefaultToolchainsWriter implements ToolchainsWriter
41 {
42
43 @Override
44 public void write( Writer output, Map<String, Object> options, PersistedToolchains toolchains ) throws IOException
45 {
46 Objects.requireNonNull( output, "output cannot be null" );
47 Objects.requireNonNull( toolchains, "toolchains cannot be null" );
48
49 try ( final Writer out = output )
50 {
51 new MavenToolchainsXpp3Writer().write( out, toolchains );
52 }
53 }
54 }