/** * 删除推荐位元数据 * * @param filePath * @return whether the delete is successful */ public boolean deletePlaceMetadata(String filePath) { File file = new File(filePath); String dirPath = file.getParent(); Map<String, CmsPlaceMetadata> metadataMap = getPlaceMetadataMap(dirPath); metadataMap.remove(file.getName()); try { savePlaceMetadata(dirPath, metadataMap); return true; } catch (IOException e) { return false; } }
/** * 删除推荐位元数据 * * @param filePath * @return whether the delete is successful */ public boolean deletePlaceMetadata(String filePath) { File file = new File(filePath); String dirPath = file.getParent(); Map<String, CmsPlaceMetadata> metadataMap = getPlaceMetadataMap(dirPath); metadataMap.remove(file.getName()); try { savePlaceMetadata(dirPath, metadataMap); return true; } catch (IOException e) { return false; } }
/** * 更新推荐位元数据 * * @param filePath * @param metadata * @return whether the update is successful */ public boolean updatePlaceMetadata(String filePath, CmsPlaceMetadata metadata) { File file = new File(filePath); String dirPath = file.getParent(); Map<String, CmsPlaceMetadata> metadataMap = getPlaceMetadataMap(dirPath); metadataMap.put(file.getName(), metadata); try { savePlaceMetadata(dirPath, metadataMap); return true; } catch (IOException e) { return false; } }
/** * 更新推荐位元数据 * * @param filePath * @param metadata * @return whether the update is successful */ public boolean updatePlaceMetadata(String filePath, CmsPlaceMetadata metadata) { File file = new File(filePath); String dirPath = file.getParent(); Map<String, CmsPlaceMetadata> metadataMap = getPlaceMetadataMap(dirPath); metadataMap.put(file.getName(), metadata); try { savePlaceMetadata(dirPath, metadataMap); return true; } catch (IOException e) { return false; } }