| | |
| | | |
| | | /** |
| | | * 通过照片路径,得到对应缩略图的路径 |
| | | * @param imgPath |
| | | * @param filePath |
| | | * @return |
| | | */ |
| | | public String getImgFileZipPath(String imgPath){ |
| | | public String getFileZipPath(String filePath){ |
| | | String path_ = null ; |
| | | String prePath = null ; |
| | | String tailPath = null ; |
| | | if(imgPath != null && !imgPath.trim().equals("")) { |
| | | int lastDotIndex = imgPath.lastIndexOf('.'); |
| | | if(filePath != null && !filePath.trim().equals("")) { |
| | | int lastDotIndex = filePath.lastIndexOf('.'); |
| | | if (lastDotIndex >= 0) { |
| | | prePath = imgPath.substring(0, lastDotIndex); |
| | | tailPath = imgPath.substring(lastDotIndex); |
| | | prePath = filePath.substring(0, lastDotIndex); |
| | | tailPath = filePath.substring(lastDotIndex); |
| | | path_ = prePath + "_" + tailPath ; |
| | | } |
| | | } |
| | | if(path_ == null){ |
| | | path_ = imgPath ; |
| | | path_ = filePath; |
| | | } |
| | | return path_ ; |
| | | } |
| | | |
| | | /** |
| | | * 通过视频路径,得到对应缩略图的路径 |
| | | * @param filePath |
| | | * @return |
| | | */ |
| | | public String getFileZipPath(String filePath, String extName){ |
| | | String path_ = null ; |
| | | String prePath = null ; |
| | | if(filePath != null && !filePath.trim().equals("")) { |
| | | int lastDotIndex = filePath.lastIndexOf('.'); |
| | | if (lastDotIndex >= 0) { |
| | | prePath = filePath.substring(0, lastDotIndex); |
| | | path_ = prePath + "_." + extName ; |
| | | } |
| | | } |
| | | if(path_ == null){ |
| | | path_ = filePath; |
| | | } |
| | | return path_ ; |
| | | } |