|
From: <mic...@us...> - 2003-11-26 17:14:12
|
Update of /cvsroot/babeldoc/babeldoc/modules/jfreereports/src/com/babeldoc/jfreereports/pipeline/stage
In directory sc8-pr-cvs1:/tmp/cvs-serv14486/modules/jfreereports/src/com/babeldoc/jfreereports/pipeline/stage
Modified Files:
Tag: TEMP_MIKEA
JFRPipelineStage.java
Log Message:
Some gentle refactoring...
Index: JFRPipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/jfreereports/src/com/babeldoc/jfreereports/pipeline/stage/Attic/JFRPipelineStage.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** JFRPipelineStage.java 26 Nov 2003 13:24:30 -0000 1.1.2.6
--- JFRPipelineStage.java 26 Nov 2003 17:14:09 -0000 1.1.2.7
***************
*** 237,249 ****
URL urlReportDefinitionUrl;
try {
! File file = new File(strReportDefinitionUrl);
! BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
! byte[] b = new byte[in.available()];
! in.read(b, 0, b.length);
! String s = new String(b, 0, b.length);
! in.close();
! xmlReportDefinition = s;
! } catch (java.net.MalformedURLException e) {
! throw new PipelineException(I18n.get("jfr.102"), e);
} catch (IOException e) {
throw new PipelineException(I18n.get("jfr.103"), e);
--- 237,241 ----
URL urlReportDefinitionUrl;
try {
! xmlReportDefinition = getStringFromFile(new File(strReportDefinitionUrl));
} catch (IOException e) {
throw new PipelineException(I18n.get("jfr.103"), e);
***************
*** 267,279 ****
URL urlReportDefinitionUrl;
try {
! File file = new File(strReportDefinitionUrl);
! BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
! byte[] b = new byte[in.available()];
! in.read(b, 0, b.length);
! String s = new String(b, 0, b.length);
! in.close();
! xmlReportDefinition = s;
! } catch (java.net.MalformedURLException e) {
! throw new PipelineException(I18n.get("jfr.102"), e);
} catch (IOException e) {
throw new PipelineException(I18n.get("jfr.103"), e);
--- 259,263 ----
URL urlReportDefinitionUrl;
try {
! xmlReportDefinition = getStringFromFile(new File(strReportDefinitionUrl));
} catch (IOException e) {
throw new PipelineException(I18n.get("jfr.103"), e);
***************
*** 334,340 ****
return bytes;
}
!
private String getTempFilename() {
return ("tempfile");
}
}
--- 318,338 ----
return bytes;
}
!
private String getTempFilename() {
return ("tempfile");
+ }
+
+ private String getStringFromFile(File file) throws java.io.IOException {
+ String s = null;
+ try {
+ BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
+ byte[] b = new byte[in.available()];
+ in.read(b, 0, b.length);
+ s = new String(b, 0, b.length);
+ in.close();
+ } catch (java.io.FileNotFoundException e1) {
+ s = "";
+ }
+ return (s);
}
}
|