private void doCopyFile(FileName fileName, File destDir)
throws DocumenterException {
InputStream in = getResource(fileName.name);
if(in == null) {
throw new DocumenterException("Could not find " + fileName.name);
}
File f = new File(destDir, fileName.name);
documenterContext.log("Writing " + f.getAbsolutePath());
try {
FileOutputStream fileOut = new FileOutputStream(f);
byte[] buffer = new byte[HTMLDocumenter.FILE_BUFFER_SIZE];
int i;
while((i = in.read(buffer)) != -1) {
fileOut.write(buffer, 0, i);
}
in.close();
fileOut.close();
}
catch(IOException ioe) {
throw new DocumenterException("problem copying file: "
+ ioe.getMessage(), ioe);
}
}