| | |
| | | String dwgUrl = fileBom.getDwgUrl(); |
| | | if(pictureUrl !=null){ |
| | | String newPictureUrl ="doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel()+File.separator+ pictureUrl.substring(pictureUrl.lastIndexOf(File.separator)+1); |
| | | File newPictureFile = new File(projectDir + File.separator + newPictureUrl); |
| | | if(!newPictureFile.exists()){ |
| | | newPictureFile.mkdirs(); |
| | | File newPictureDir = new File(projectDir + File.separator + "doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel()); |
| | | if(!newPictureDir.exists()){ |
| | | newPictureDir.mkdirs(); |
| | | } |
| | | FileCopyUtils.copy(new File(projectDir+File.separator+ pictureUrl), |
| | | newPictureFile); |
| | | new File(projectDir+File.separator+newPictureUrl)); |
| | | fileBom.setPictureUrl(newPictureUrl); |
| | | } |
| | | if(dwgUrl !=null){ |
| | | String newDwgUrl ="doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel()+File.separator+ dwgUrl.substring(dwgUrl.lastIndexOf(File.separator)+1); |
| | | File newDwgFile = new File(projectDir + File.separator + newDwgUrl); |
| | | if(!newDwgFile.exists()){ |
| | | newDwgFile.mkdirs(); |
| | | File newDwgDir = new File(projectDir + File.separator + "doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel()); |
| | | if(!newDwgDir.exists()){ |
| | | newDwgDir.mkdirs(); |
| | | } |
| | | FileCopyUtils.copy(new File(projectDir+File.separator+ dwgUrl), |
| | | newDwgFile); |
| | | new File(newDwgUrl)); |
| | | fileBom.setDwgUrl(newDwgUrl); |
| | | } |
| | | } catch (IOException e) { |