int size = (int)inFile.length();\r
byte[] buffer = new byte[size];\r
File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);\r
- try{\r
- if (inFile.exists()) {\r
- FileInputStream fis = new FileInputStream (inFile);\r
- fis.read(buffer);\r
- FileOutputStream fos = new FileOutputStream(outFile);\r
- fos.write(buffer);\r
- fis.close();\r
- fos.close();\r
- }else {\r
- throw new AutoGenException("The flashMap.h file don't exist!!");\r
+ //\r
+ // If TianoR8FlashMap.h existed and the flashMap.h don't change, \r
+ // do nothing.\r
+ // \r
+ if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {\r
+ try{\r
+ if (inFile.exists()) {\r
+ FileInputStream fis = new FileInputStream (inFile);\r
+ fis.read(buffer);\r
+ FileOutputStream fos = new FileOutputStream(outFile);\r
+ fos.write(buffer);\r
+ fis.close();\r
+ fos.close();\r
+ }else {\r
+ throw new AutoGenException("The flashMap.h file don't exist!!");\r
+ }\r
+ } catch (Exception e){\r
+ throw new AutoGenException(e.getMessage());\r
}\r
- } catch (Exception e){\r
- throw new AutoGenException(e.getMessage());\r
- }\r
- \r
+ }\r
}\r
-\r
}
\ No newline at end of file