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; }
@Transient public BigDecimal getUnitPrice() { if ((getProduct() != null) && (getProduct().getPrice() != null)) { Setting localSetting = SettingUtils.get(); if ((getCart() != null) && (getCart().getMember() != null) && (getCart().getMember().getMemberRank() != null)) { MemberRank localMemberRank = getCart().getMember().getMemberRank(); Map<MemberRank, BigDecimal> localMap = getProduct().getMemberPrice(); if ((localMap != null) && (!localMap.isEmpty()) && (localMap.containsKey(localMemberRank))) return localSetting.setScale((BigDecimal) localMap.get(localMemberRank)); if (localMemberRank.getScale() != null) return localSetting.setScale( getProduct() .getPrice() .multiply(new BigDecimal(localMemberRank.getScale().doubleValue()))); } return localSetting.setScale(getProduct().getPrice()); } return new BigDecimal(0); }
public String getUrl(String path) { Setting localSetting = SettingUtils.get(); return localSetting.getSiteUrl() + path; }