| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.volumn.method.VolumnManagement; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.volume.VolumeServicePrx; |
| | | import com.vci.file.clientutil.VciFileServerClientUtil; |
| | | import com.vci.file.enumpck.VciFileTransProtocolEnum; |
| | | import com.vci.file.pagemodel.VciFileObjectVO; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.vci.file.constant.VciFileLangCodeConstant.*; |
| | | import static com.vci.file.constant.VciFileLangCodeConstant.FILE_NOT_FOUND; |
| | | import static com.vci.file.constant.VciFileLangCodeConstant.FILE_READ_FAIL; |
| | | import static com.vci.frameworkcore.constant.FrameWorkLangCodeConstant.*; |
| | | |
| | | /** |
| | |
| | | } |
| | | }else if(VciFileTransProtocolEnum.CORBA.getValue().equalsIgnoreCase(vciFileVolumeVO.getTransProtocol())){ |
| | | String volumeName = vciFileVolumeVO.getName(); |
| | | VolumnManagement volumnCorbaService = null; |
| | | try { |
| | | volumnCorbaService = platformClientUtil.getVolumeService(vciFileVolumeVO.getServiceUrl(),volumeName).getVolumnService(); |
| | | } catch (VCIError vciError) { |
| | | throw new VciBaseException("没有获取到{}的卷服务",new String[]{volumeName},vciError); |
| | | VolumeServicePrx volumnCorbaService = platformClientUtil.getVolumeService(volumeName); |
| | | if(volumnCorbaService == null){ |
| | | throw new VciBaseException("没有获取到卷服务"); |
| | | } |
| | | //平台2020版本此处修改了,卷的文件夹是由卷服务来控制 |
| | | String serverPath = vciFileObjectVO.getFilePath(); |
| | | long fileSize = 0; |
| | | try { |
| | | fileSize = volumnCorbaService.getFileSize(serverPath); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("没有在卷服务{}里获取到文件{}的大小",new String[]{volumeName,fileName},vciError); |
| | | } |
| | | try { |
| | |
| | | throw new VciBaseException("要写入的文件没有找到",new String[]{tempFilePath},e); |
| | | } catch (IOException e) { |
| | | throw new VciBaseException("写入文件出错" + e.getMessage(),new String[]{tempFilePath},e); |
| | | } catch (VCIError e){ |
| | | } catch (PLException e){ |
| | | // throw new VciBaseException("卷服务传输文件时出现了错误" + e.error_code,e.error_message,e); |
| | | }catch (Exception e){ |
| | | throw new VciBaseException("卷服务传输文件时出现了错误" + e.getMessage(),new String[0],e); |
| | |
| | | } |
| | | }else if(VciFileTransProtocolEnum.CORBA.getValue().equalsIgnoreCase(vciFileVolumeVO.getTransProtocol())){ |
| | | String volumeName = vciFileVolumeVO.getName(); |
| | | VolumnManagement volumnCorbaService = null; |
| | | try { |
| | | volumnCorbaService = platformClientUtil.getVolumeService(vciFileVolumeVO.getServiceUrl(),volumeName).getVolumnService(); |
| | | } catch (VCIError vciError) { |
| | | throw new VciBaseException("没有获取到{}的卷服务",new String[]{volumeName},vciError); |
| | | VolumeServicePrx volumnCorbaService = platformClientUtil.getVolumeService(volumeName); |
| | | if(volumnCorbaService == null){ |
| | | throw new VciBaseException("没有获取到卷服务"); |
| | | } |
| | | String serverPath = vciFileVolumeVO.getVolumePath() + File.separator + vciFileObjectVO.getFilePath().replace(volumeName+":",""); |
| | | long fileSize = 0; |
| | | try { |
| | | fileSize = volumnCorbaService.getFileSize(serverPath); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("没有在卷服务{}里获取到文件{}的大小",new String[]{volumeName,fileName},vciError); |
| | | } |
| | | try { |
| | |
| | | } |
| | | }else if(VciFileTransProtocolEnum.CORBA.getValue().equalsIgnoreCase(vciFileVolumeVO.getTransProtocol())){ |
| | | String volumeName = vciFileVolumeVO.getName(); |
| | | VolumnManagement volumnCorbaService = null; |
| | | try { |
| | | volumnCorbaService = platformClientUtil.getVolumeService(vciFileVolumeVO.getServiceUrl(),volumeName).getVolumnService(); |
| | | } catch (VCIError vciError) { |
| | | throw new VciBaseException("没有获取到{}的卷服务",new String[]{volumeName},vciError); |
| | | VolumeServicePrx volumnCorbaService = platformClientUtil.getVolumeService(volumeName); |
| | | if(volumnCorbaService == null){ |
| | | throw new VciBaseException("没有获取到卷服务"); |
| | | } |
| | | //平台2020版本此处修改了,卷的文件夹是由卷服务来控制 |
| | | String serverPath = volumeId+":" + filePath; |
| | | long fileSize = 0; |
| | | try { |
| | | fileSize = volumnCorbaService.getFileSize(serverPath); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("没有在卷服务{}里获取到文件{}的大小",new String[]{volumeName,fileName},vciError); |
| | | } |
| | | try { |
| | |
| | | throw new VciBaseException("要写入的文件没有找到",new String[]{tempFilePath},e); |
| | | } catch (IOException e) { |
| | | throw new VciBaseException("写入文件出错" + e.getMessage(),new String[]{tempFilePath},e); |
| | | } catch (VCIError e){ |
| | | } catch (PLException e){ |
| | | // throw new VciBaseException("卷服务传输文件时出现了错误" + e.error_code,e.error_message,e); |
| | | }catch (Exception e){ |
| | | throw new VciBaseException("卷服务传输文件时出现了错误" + e.getMessage(),new String[0],e); |