1 package com.atlassian.plugin.webresource;
2
3 import java.io.IOException;
4 import java.io.OutputStream;
5
6 /**
7 * If a minified files follows another file and the former does not have a free floating carriage return AND ends in
8 * a // comment then the one line minified file will in fact be lost from view in a batched send. So we need
9 * to put a new line between files
10 * <p/>
11 * This is a stateless implementation of the {@link ResourceContentAnnotator} that will write a newline after each resource.
12 */
13 class NewlineResourceContentAnnotator implements ResourceContentAnnotator
14 {
15 @Override
16 public void before(OutputStream stream) throws IOException
17 {
18 // Nothing doing
19 }
20
21 @Override
22 public void after(OutputStream stream) throws IOException
23 {
24 stream.write('\n');
25 }
26 }