public List<FileInfo> browser(String path) { Setting localSetting = SettingUtils.get(); List<FileInfo> localArrayList = new ArrayList<FileInfo>(); File localFile1 = new File(this.servletContext.getRealPath(path)); if ((localFile1.exists()) && (localFile1.isDirectory())) for (File localFile2 : localFile1.listFiles()) { FileInfo localFileInfo = new FileInfo(); localFileInfo.setName(localFile2.getName()); localFileInfo.setUrl(localSetting.getSiteUrl() + path + localFile2.getName()); localFileInfo.setIsDirectory(Boolean.valueOf(localFile2.isDirectory())); localFileInfo.setSize(Long.valueOf(localFile2.length())); localFileInfo.setLastModified(new Date(localFile2.lastModified())); localArrayList.add(localFileInfo); } return localArrayList; }
public String getUrl(String path) { Setting localSetting = SettingUtils.get(); return localSetting.getSiteUrl() + path; }