public void saveImages(List<Cache> list, int folderid) {
		// TODO Auto-generated method stub
		Folder folder = this.folderDao.getFolder(folderid);
		File basePath = new File(ServletActionContext.getServletContext().getRealPath("cache"));
    	if(!basePath.exists()){  
             basePath.mkdirs();  
        } 
    	File filePath = new File(ServletActionContext.getServletContext().getRealPath("xiaoming"));
    	if(!filePath.exists()){  
            filePath.mkdirs();  
       } 
    	//List<Photo> photos = new ArrayList<Photo>();
    	Photo first = null;
		for(Cache cache : list)
		{
			Photo photo = new Photo();
			photo.setFolder(folder);
			photo.setDescription(cache.getMark());
			
		    folderDao.save(photo);
		    if(first==null)
		    	first = photo;
		    photo.setName(photo.getId()+cache.getType());
		    
	    	File cachefile = new File(basePath.getAbsolutePath()+File.separator+cache.getUuid());
	    	File destfile = new File(filePath.getAbsolutePath()+File.separator+photo.getName());
	    	cachefile.renameTo(destfile);
	        
	        BufferedImage sourceImg = null;
			try {
				sourceImg = ImageIO.read(new FileInputStream(destfile));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}   
			if(sourceImg!=null)
	        photo.setSize(sourceImg.getWidth()+"*"+sourceImg.getHeight());
	    	cachefile.delete();
	    	folderDao.update(photo);
	    	if(cache.isRadio())
	    	{
	    		folder.setFengmian(photo);
	    	}
		}
		if(folder.getFengmian()==null)
			folder.setFengmian(first);
		folder.setSize(folder.getSize()+list.size());
		folderDao.update(folder);
	}