//특정 날짜 이전의 폴더 삭제
public static boolean deleteDateFolder(String rootDir,int gap)
{
boolean result = false;
/*String rootDir = "G:\\01.workspace\\3.5.1_workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp9\\wtpwebapps\\EVA-EDMS_KICA\\storage";*/
File targetDir = new File(rootDir);
if(targetDir.isDirectory())
{
try
{
Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = (c.get(Calendar.MONTH)+1);
int day = (c.get(Calendar.DATE)-0);
String month_str = "";
String day_str = "";
if(month<10){ month_str="0"+month; }else{ month_str=""+month; }
if(day<10){ day_str="0"+day; }else{ day_str=""+day; }
int targetDate = Integer.parseInt(year+""+month_str+""+day_str);
String[] dayTargetNames = targetDir.list(null);
for(int k = 0; k < dayTargetNames.length; ++k){
if(targetDir.isDirectory()){
String dayTargetName = dayTargetNames[k];
int iDayTargetDir = Integer.parseInt(dayTargetName);
if(iDayTargetDir < targetDate){
System.out.println("[deleteDay] " + dayTargetName);
Common.deleteAll(rootDir+"/"+dayTargetName);
}
}
}
result = true;
}
catch(Exception e)
{
e.printStackTrace();
}
}
return result;
}