コード例 #1
0
  private void deleteFragment(StoryFragment fragment) {
    try {
      for (UUID id : fragment.getMediaIds()) {
        es.deleteImage(id);
      }

      es.deleteFragment(fragment.getFragmentID());
    } catch (Exception e) {
    }
  }
コード例 #2
0
  /* (non-Javadoc)
   * @see ca.cmput301f13t03.adventure_datetime.model.IWebStorage#deleteStory(java.util.UUID)
   */
  @Override
  public boolean deleteStory(UUID storyId) throws Exception {
    JestResult result =
        execute(new Delete.Builder(storyId.toString()).index(_index).type("story").build());

    // try to delete Image
    try {
      deleteImage(storyId);
    } catch (Exception e) {
      // I don't care if this fails
    }

    return result.isSucceeded();
  }