4ddf1b5c31a2ad02797f7183a3bd83140f557a1c
[debian/jabref.git] / debian / patches / 05_PrintStream_File.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 05_PrintStream_File.dpatch by  <gregor+debian@comodo.priv.at>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: "The constructor PrintStream(File) is undefined"
6 ## DP: Work around with a FileOutputStream.
7
8 @DPATCH@
9 diff -urNad jabref~/src/java/net/sf/jabref/sql/SQLutil.java jabref/src/java/net/sf/jabref/sql/SQLutil.java
10 --- jabref~/src/java/net/sf/jabref/sql/SQLutil.java     2008-03-16 17:01:04.000000000 +0100
11 +++ jabref/src/java/net/sf/jabref/sql/SQLutil.java      2008-03-16 17:03:07.000000000 +0100
12 @@ -11,6 +11,8 @@
13  
14  import java.io.File;
15  import java.io.PrintStream;
16 +import java.io.BufferedOutputStream;
17 +import java.io.FileOutputStream;
18  import java.sql.Connection;
19  import java.sql.DriverManager;
20  import java.sql.SQLException;
21 @@ -261,8 +263,10 @@
22          if (outfile.exists())
23              outfile.delete();
24  
25 +        BufferedOutputStream writer = null;
26 +        writer = new BufferedOutputStream( new FileOutputStream( outfile ) );
27          PrintStream fout = null;
28 -        fout = new PrintStream(outfile);
29 +        fout = new PrintStream( writer );
30  
31          exportDatabase_worker(dbtype, database, metaData, keySet, fout);
32