Skip to content

Commit ae19710

Browse files
author
eugenp
committed
small fop changes
1 parent e700227 commit ae19710

File tree

2 files changed

+324
-12
lines changed

2 files changed

+324
-12
lines changed

apache-fop/src/test/java/org/baeldung/java/ApacheFOPHeroldTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232

3333
public class ApacheFOPHeroldTest {
3434
private String[] inputUrls = {// @formatter:off
35-
"http://www.baeldung.com/2011/10/20/bootstraping-a-web-application-with-spring-3-1-and-java-based-configuration-part-1/",
35+
"http://www.baeldung.com/2011/10/20/bootstraping-a-web-application-with-spring-3-1-and-java-based-configuration-part-1/",
3636
// "http://www.baeldung.com/2011/10/25/building-a-restful-web-service-with-spring-3-1-and-java-based-configuration-part-2/",
37-
// "http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/",
38-
"http://www.baeldung.com/spring-security-basic-authentication",
37+
// "http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/",
38+
// "http://www.baeldung.com/spring-security-basic-authentication",
3939
// "http://www.baeldung.com/spring-security-digest-authentication",
4040
//"http://www.baeldung.com/2011/11/20/basic-and-digest-authentication-for-a-restful-service-with-spring-security-3-1/",
4141
//"http://www.baeldung.com/spring-httpmessageconverter-rest",
4242
//"http://www.baeldung.com/2011/11/06/restful-web-service-discoverability-part-4/",
4343
//"http://www.baeldung.com/2011/11/13/rest-service-discoverability-with-spring-part-5/",
4444
//"http://www.baeldung.com/2013/01/11/etags-for-rest-with-spring/",
45-
"http://www.baeldung.com/2012/01/18/rest-pagination-in-spring/",
45+
// "http://www.baeldung.com/2012/01/18/rest-pagination-in-spring/",
4646
//"http://inprogress.baeldung.com/?p=1430",
4747
//"http://www.baeldung.com/2013/01/31/exception-handling-for-rest-with-spring-3-2/",
4848
//"http://www.baeldung.com/rest-versioning",
@@ -68,7 +68,7 @@ public void whenTransformFromHeroldToPDF_thenCorrect() throws Exception {
6868

6969
// UTIL
7070

71-
private void fromHTMLTOXMLUsingHerold(final String input, boolean append) throws Exception {
71+
private void fromHTMLTOXMLUsingHerold(final String input, final boolean append) throws Exception {
7272
Script script;
7373
final TrafoScriptManager mgr = new TrafoScriptManager();
7474
final File profileFile = new File("src/test/resources/default.her");
@@ -87,7 +87,7 @@ private Document fromXMLFileToFO() throws Exception {
8787
return (Document) result.getNode();
8888
}
8989

90-
private void fromFODocumentToPDF(Document fo, final String outputFile) throws Exception {
90+
private void fromFODocumentToPDF(final Document fo, final String outputFile) throws Exception {
9191
final FopFactory fopFactory = FopFactory.newInstance();
9292
final OutputStream outStream = new BufferedOutputStream(new FileOutputStream(new File(outputFile)));
9393

@@ -112,10 +112,10 @@ private InputStream getInputStream(final String input) throws IOException {
112112
final URL url = new URL(input);
113113
return url.openStream();
114114
}
115-
116-
private void fixXML(String input, String output) throws IOException{
117-
BufferedReader reader = new BufferedReader(new FileReader(input));
118-
FileWriter writer = new FileWriter(output);
115+
116+
private void fixXML(final String input, final String output) throws IOException{
117+
final BufferedReader reader = new BufferedReader(new FileReader(input));
118+
final FileWriter writer = new FileWriter(output);
119119
String line = reader.readLine();
120120
int count = 0;
121121
while(line != null){
@@ -124,9 +124,9 @@ private void fixXML(String input, String output) throws IOException{
124124
}
125125
else if(!((line.startsWith("<?xml") || line.startsWith("<article") || line.startsWith("</article")) && count > 4)){
126126
writer.write(line.replaceAll("xml:id=\"", "xml:id=\""+count));
127-
}
127+
}
128128
writer.write("\n");
129-
129+
130130
line = reader.readLine();
131131
count++;
132132
}

0 commit comments

Comments
 (0)