Examples of FileSystemForm


Examples of com.adito.networkplaces.forms.FileSystemForm

   */
  public ActionForward gotoPath(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("goto path location.");
    FileSystemForm fileSystemForm = (FileSystemForm) form;
    fileSystemForm.clearPathsTo(request.getParameter("id"));
    return this.list(mapping, fileSystemForm, request, response);
  }
View Full Code Here

Examples of com.adito.networkplaces.forms.FileSystemForm

   */
  public ActionForward renameFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("rename the file.");
    FileSystemForm fileSystemForm = (FileSystemForm) form;

    checkLaunchSession(request, response, fileSystemForm);
    ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
    if (fwd != null) {
      return fwd;
    }

    VFSResource sourceResource = null;
    VFSResource destResource = null;
    try {
      sourceResource = getResourceForPath(fileSystemForm.getLaunchSession(),
        request,
        response,
        fileSystemForm.getPath() + "/" + fileSystemForm.getFileName());
      destResource = getResourceForPath(fileSystemForm.getLaunchSession(), request, response, fileSystemForm.getPath() + "/"
        + fileSystemForm.getNewName());

      if (sourceResource == null) {
        throw new Exception("Could not locate source resource '" + fileSystemForm.getPath()
          + "/"
          + fileSystemForm.getFileName()
          + "'");
      }
      if (destResource == null) {
        throw new Exception("Could not locate destination resource '" + fileSystemForm.getPath()
          + "/"
          + fileSystemForm.getNewName()
          + "'");
      }
           
            if(sourceResource.getFullPath().equals(destResource.getFullPath())) {
                return mapping.findForward("list");
            }
           
      fwd = checkMount(destResource, mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      sourceResource.move(destResource, true);

      if (sourceResource.getMount().getStore().getProvider().isFireEvents()) {
        CoreServlet.getServlet().fireCoreEvent(NetworkPlaceResourceType.getResourceAccessRenameEvent(this,
          fileSystemForm.getLaunchSession(),
          request,
          fileSystemForm.getPath(),
          fileSystemForm.getFullURI(),
          sourceResource.getDisplayName(),
          destResource.getDisplayName(),
          null));
      }

    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
      return null;
    } catch (Exception e) {
      if (sourceResource != null && destResource != null) {
        if (sourceResource.getMount().getStore().getProvider().isFireEvents()) {
          CoreServlet.getServlet().fireCoreEvent(NetworkPlaceResourceType.getResourceAccessRenameEvent(this,
            fileSystemForm.getLaunchSession(),
            request,
            fileSystemForm.getPath(),
            fileSystemForm.getFullURI(),
            sourceResource.getDisplayName(),
            destResource.getDisplayName(),
            e));
        }
      }
View Full Code Here

Examples of com.adito.networkplaces.forms.FileSystemForm

   */
  public ActionForward upload(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("List files.");
    FileSystemForm fileSystemForm = (FileSystemForm) form;
    checkLaunchSession(request, response, fileSystemForm);
    ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
    if (fwd != null) {
      return fwd;
    }
    ActionForward returnTo = new ActionForward("/fileSystem.do?" + LaunchSession.LAUNCH_ID + "=" + fileSystemForm.getLaunchSession().getId()
      + "&actionTarget=list&path="
      + DAVUtilities.encodePath(fileSystemForm.getPath()), true);
    UploadDetails details = new UploadDetails(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            NetworkPlaceUploadHandler.TYPE_VFS,
            fileSystemForm.getPath(),
            mapping.findForward("upload"),
            returnTo,
            null);
    details.setExtraAttribute1(fileSystemForm.getPath());
    details.setExtraAttribute2(fileSystemForm.getLaunchSession().getId());
    request.setAttribute(Constants.REQ_ATTR_UPLOAD_DETAILS, new Integer(CoreUtil.addUpload(request.getSession(), details)));
    return mapping.findForward("upload");
  }
View Full Code Here

Examples of com.adito.networkplaces.forms.FileSystemForm

   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("List files.");
    FileSystemForm fileSystemForm = (FileSystemForm) form;

    try {
      VFSResource res = checkLaunchSession(request, response, fileSystemForm);
      ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      fwd = checkMount(res, mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }

      /**
       * LDP - This extra getChildren exception was being ignored. This is not
       * acceptable behaviour, instead we now catch the exception and display as
       * an error on screen, and log to file.
       *
       * This extra getChildren also meant that each directory is listed TWICE!
       */
//           
//            try {
//                res.getChildren();
//                // if we can't get the children we are assuming access was denied
//            } catch (FileSystemException e) {
//
//            }
           
      buildModel(res, fileSystemForm, request);
      if (res.getMount().getStore().getProvider().isFireEvents()) {
        CoreServlet.getServlet().fireCoreEvent(NetworkPlaceResourceType.getResourceAccessListEvent(this,
          fileSystemForm.getLaunchSession(),
          request,
          fileSystemForm.getPath(),
          fileSystemForm.getFullURI(),
          null));
      }
    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
      return null;
    } catch (UnknownHostException e) {
            ActionMessages errs = getErrors(request);
            errs.add(Globals.ERROR_KEY, new ActionMessage("error.networkPlaces.unknown.host", e.getMessage()));
            saveErrors(request, errs);
            return mapping.findForward("display");
    } catch (Exception e) {
      CoreServlet.getServlet().fireCoreEvent(NetworkPlaceResourceType.getResourceAccessListEvent(this,
          fileSystemForm.getLaunchSession(),
          request,
          fileSystemForm.getPath(),
          fileSystemForm.getFullURI(),
          e));
     
            ActionMessages errs = getErrors(request);
            errs.add(Globals.ERROR_KEY, new ActionMessage("error.networkPlaces.generic", VfsUtils.maskSensitiveArguments(e.getMessage())));
            saveErrors(request, errs);
View Full Code Here

Examples of com.adito.networkplaces.forms.FileSystemForm

  public ActionForward zip(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("Zip files.");

    FileSystemForm fileSystemForm = (FileSystemForm) form;

    try {
      VFSResource res = checkLaunchSession(request, response, fileSystemForm);
      ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      buildModel(res, fileSystemForm, request);
      String[] uris = fileSystemForm.getSelectedFileNames();
      if (uris == null || uris.length < 1) {
        ActionMessages msgs = getErrors(request);
        msgs.add(Globals.ERROR_KEY, new ActionMessage("vfs.zip.select.error"));
        saveErrors(request, msgs);
        return mapping.getInputForward();
View Full Code Here

Examples of com.adito.networkplaces.forms.FileSystemForm

   */
  public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("Delete files.");
    FileSystemForm fileSystemForm = (FileSystemForm) form;

    try {
      VFSResource res = checkLaunchSession(request, response, fileSystemForm);
      ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      fwd = checkMount(res, mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      buildModel(res, fileSystemForm, request);
      String[] uris = fileSystemForm.getSelectedFileNames();
      for (int i = 0; i < uris.length; i++) {
        String delPath = fileSystemForm.getPath() + "/" + uris[i];
        deleteSingleFile(request, response, delPath, fileSystemForm);
      }
      return mapping.findForward("list");
    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.