67,550
社区成员




public static final String Definition.FILE_ROOT_FOLDER = "files";
protected String getType(String attachmentFileName) {
int i = attachmentFileName.lastIndexOf(".");
String type = attachmentFileName.substring(i + 1);
return type;
}
private String getRefStorePath(String attachmentFileName) {
StringBuffer sb = new StringBuffer(Definition.FILE_ROOT_FOLDER);
String type = this.getType(attachmentFileName);
sb.append(System.getProperty("file.separator")).append(type);
Date date = new Date();
java.text.SimpleDateFormat sdf = new SimpleDateFormat("yyyy"+System.getProperty("file.separator")+"MM"+System.getProperty("file.separator")+"dd"+System.getProperty("file.separator")+"hh"+System.getProperty("file.separator")+"mm");
String dateStr = sdf.format(date);
sb.append(System.getProperty("file.separator")).append(dateStr);
return sb.toString();
}
File file = new File(PATH);
if (!file .exists()) {
file .mkdirs();
}