package com.platform.utils;

import java.util.ArrayList;
import java.util.List;

import com.platform.entities.FolderNode;
import com.platform.entities.VolumeDataEntity;
import com.platform.http.gfs.SetVolume;

public class GetVolumeInfo {

	/** 将gfs 的 volume\folder 存入缓存
	 * 
	 */
	public void getVolumeMsg() throws Exception{
		List<FolderNode> folderlist = new ArrayList<FolderNode>();
		List<VolumeDataEntity> volumeList = new ArrayList<VolumeDataEntity>();
		SetVolume volumeClient = new SetVolume();
		volumeList = volumeClient.getAllvolumeEntity();
		for (VolumeDataEntity volumeEntity : volumeList) {
			if (null != volumeEntity.getFolder()) {
				folderlist.addAll(volumeEntity.getFolder());
			}
		}
		//  更新folder 目录
		CacheTreeData.setVolumeList(volumeList);
		CacheTreeData.setFolders(folderlist);
	}

}
