| package com.dy.pipIrrWebFile.util; | 
|   | 
| import com.dy.common.util.DateTime; | 
| import com.dy.pipIrrGlobal.dyFile.FileConstant; | 
|   | 
| import java.io.File; | 
|   | 
| public class FilePhotoUtil extends FileUtil { | 
|      | 
|      | 
|     /** | 
|      * 生成文件相对路径名称 | 
|      *  | 
|      * @param absolutePath | 
|      * @param relativePath | 
|      * @param regionNum | 
|      * @return | 
|      */ | 
|     public String newFileRelativityPath(String absolutePath, String relativePath, String regionNum) { | 
|         String relativityPath = relativePath ; | 
|         if(regionNum != null && !regionNum.trim().equals("") && !regionNum.trim().equals(FileConstant.NotRegionNum)){ | 
|             relativityPath += ("-"  + regionNum) ; | 
|         }else{ | 
|             if(com.dy.pipIrrWebFile.util.FileConstant.photoFileBasePath.startsWith("/")){ | 
|                 if(relativityPath.endsWith("/")){ | 
|                     relativityPath = relativityPath.substring(0, relativityPath.length() - 1) ; | 
|                 } | 
|             } | 
|         } | 
|         relativityPath += com.dy.pipIrrWebFile.util.FileConstant.photoFileBasePath + DateTime.yyyyMMdd() + "/"; | 
|         String filePath = absolutePath + relativityPath; | 
|         File dir = new File(filePath); | 
|         if (!dir.exists()) { | 
|             dir.mkdirs(); | 
|         } | 
|         return relativityPath; | 
|     } | 
|      | 
| } |