Package org.apache.wookie.exceptions

Examples of org.apache.wookie.exceptions.ResourceNotFoundException


      found = new SharedContext(instance).removeSharedData(name);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
    } else {
      found = updatePreference(instance, name, null);
    }
    if (!found) throw new ResourceNotFoundException();
    return true;
 
View Full Code Here


     
      //
      // Policy doesn't exist so return 404
      //
      if (!Policies.getInstance().exists(policy)){
        throw new ResourceNotFoundException();
      }
     
      Policies.getInstance().removePolicy(policy);
      return true;
     
View Full Code Here

   */
  @Override
  protected void show(String resourceId, HttpServletRequest request, HttpServletResponse response) throws ResourceNotFoundException, UnauthorizedAccessException, IOException {
    IWidgetInstance instance = WidgetInstancesController.getLocalizedWidgetInstance(request);
    if (instance == null){
      throw new ResourceNotFoundException();
    } else {
      //
      // Check the API key matches
      //
      String apiKey = request.getParameter("api_key");
View Full Code Here

    if(userId==null || sharedDataKey==null || (serviceType==null && widgetId==null)){
      throw new InvalidParametersException();
    }
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if(instance==null){
      throw new ResourceNotFoundException();
    }
    else{
      WidgetInstanceFactory.destroy(instance);
      return true;
    }       
View Full Code Here

        logger.error("Problem with keys properties configuration", e);
      } finally {
        lock.unlock();
      }
    } else {
      throw new ResourceNotFoundException();
    }
  }
View Full Code Here

  // Implementation
 
  @Override
  public void show(String resourceId,HttpServletRequest request, HttpServletResponse response) throws UnauthorizedAccessException,ResourceNotFoundException, IOException{
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new ResourceNotFoundException();
    IParticipant[] participants = new SharedContext(instance).getParticipants();
    switch (format(request)) {
       case XML: returnXml(ParticipantHelper.createXMLParticipantsDocument(participants),response);break;
       case JSON: returnJson(ParticipantHelper.createJSONParticipantsDocument(participants),response);break;
       default: returnXml(ParticipantHelper.createXMLParticipantsDocument(participants),response);break;
View Full Code Here

    String participantId = request.getParameter("participant_id"); //$NON-NLS-1$
    if(new SharedContext(instance).removeParticipant(participantId)){
      Notifier.notifyWidgets(session, instance, Notifier.PARTICIPANTS_UPDATED);
      return true;
    }else{
      throw new ResourceNotFoundException();       
    }
  }
View Full Code Here

      UnauthorizedAccessException, IOException {
    // attempt to get specific widget by id; note that this is the internal
    // widget integer ID and not the widget URI
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
    if (widget == null) throw new ResourceNotFoundException();
    // redirect to the UDD
    if (widget.getUpdateLocation() ==  null) throw new ResourceNotFoundException();
    response.sendRedirect(widget.getUpdateLocation());
  }
View Full Code Here

      throws ResourceNotFoundException, InvalidParametersException,
      UnauthorizedAccessException {
      // attempt to get specific widget by id
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
      if (widget == null) throw new ResourceNotFoundException();
     
      // Check to see if we're requiring updates over HTTPS - if not output a warning
      boolean onlyUseHttps = Boolean.parseBoolean(request.getParameter("use-https"));
      if (!onlyUseHttps) _logger.warn("checking for updates using non-secure method");
     
View Full Code Here

   
    //
    // If there is no resource part of the requested path, or the request is not for a ".wgt" file, return a 404 immediately
    //
    if (resourceId == null || resourceId.trim().length() == 0 || !resourceId.endsWith(".wgt")) {
      throw new ResourceNotFoundException();
    }
   
    //
    // Get the file path for the requested item
    //
    String requestedPackageFilePath = request.getSession().getServletContext().getRealPath(FlatpackFactory.DEFAULT_FLATPACK_FOLDER+"/"+resourceId);
   
    //
    // Get the widget package corresponding to the path, and throw a 404 if it doesn't exist
    //
    File widgetPackage = new File(requestedPackageFilePath);
    if (!widgetPackage.exists()){
      throw new ResourceNotFoundException();
    }
   
    //
    // Log the download and the IP used
    //
View Full Code Here

TOP

Related Classes of org.apache.wookie.exceptions.ResourceNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.