Package com.adito.networkplaces.forms

Examples of com.adito.networkplaces.forms.FileSystemForm


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

    try {
      checkLaunchSession(request, response, fileSystemForm);
      ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      String[] uris = { fileSystemForm.getFileName() };
      return zipSelection(mapping, request, fileSystemForm, uris);
    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
      return null;
    }
View Full Code Here


              throws Exception {
      if (log.isDebugEnabled()) {
          log.debug("Paste file.");
        }
      try {
            FileSystemForm fileSystemForm = (FileSystemForm) form;
            checkLaunchSession(request, response, fileSystemForm);
          ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
          if (fwd != null) {
              return fwd;
          }
         
          String path = DAVUtilities.concatenatePaths(fileSystemForm.getPath(), fileSystemForm.getFileName());
          if (requiresOverwriteCheck) {
              boolean isOverwritingFiles = isOverwritingFiles(request, response, path, fileSystemForm);
              if (isOverwritingFiles) {
                  return mapping.findForward("pasteOverwriteFiles");
              }
View Full Code Here

   */
  public ActionForward cut(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("Cut 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);
      Object[] uris = fileSystemForm.getSelectedFileNames();
      if (uris == null || uris.length < 1) {
        ActionMessages msgs = getErrors(request);
        msgs.add(Globals.ERROR_KEY, new ActionMessage("vfs.cut.select.error"));
        saveErrors(request, msgs);
        return mapping.getInputForward();
      }
      copyFilesToClipboard(form, request, response, true, fileSystemForm.getSelectedFileNames());
      return mapping.findForward("list");
    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
      return null;
    }
View Full Code Here

   */
  public ActionForward copy(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    if (log.isDebugEnabled())
      log.debug("Copy 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();
      if (uris == null || uris.length < 1) {
        ActionMessages msgs = getErrors(request);
        msgs.add(Globals.ERROR_KEY, new ActionMessage("vfs.copy.select.error"));
        saveErrors(request, msgs);
        return mapping.getInputForward();
View Full Code Here

   * @param uris uris to copy
   */
  private void copyFilesToClipboard(ActionForm form, HttpServletRequest request, HttpServletResponse response,
                    boolean deleteOnPaste, String[] uris) {
    ActionMessages msgs = new ActionMessages();
    FileSystemForm fileSystemForm = (FileSystemForm) form;
    String allFiles = "";
    Clipboard cb = new Clipboard();
    if (uris != null) {
      for (int i = 0; i < uris.length; i++) {
        String divider = allFiles.equals("") ? "" : ", ";
        allFiles = allFiles + divider + uris[i];
        NetworkPlaceClipboardContent fcc = new NetworkPlaceClipboardContent(fileSystemForm.getPath() + "/" + uris[i],
                deleteOnPaste);
        cb.addContent(fcc);
      }
      msgs.add(Globals.MESSAGE_KEY, new ActionMessage("vfs.copy.to.clipboard", allFiles));
    }
View Full Code Here

                    throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("Paste files.");
        }
        try {
            FileSystemForm fileSystemForm = (FileSystemForm) form;
            ActionForward validatePasteForward = validatePasteForward(mapping, fileSystemForm, request, response);
            if(validatePasteForward != null) {
                return validatePasteForward;
            }
           
            String path = DAVUtilities.concatenatePaths(fileSystemForm.getPath(), fileSystemForm.getFileName());
            if (requiresOverwriteCheck) {
                boolean isOverwritingFiles = isOverwritingFiles(request, response, path, fileSystemForm);
                if (isOverwritingFiles) {
                    return mapping.findForward("pasteOverwriteFiles");
                }
View Full Code Here

   * @return <code>ActionForward<code> The result of the action.
   * @throws Exception if aan exception is thrown.
   */
  public ActionForward mkdir(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    FileSystemForm fileSystemForm = (FileSystemForm) form;
    checkLaunchSession(request, response, fileSystemForm);
    ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
    if (fwd != null) {
      return fwd;
    }
    String path = DAVUtilities.stripTrailingSlash(fileSystemForm.getPath() + "/" + fileSystemForm.getNewFolder()) + "/";
    VFSResource res = null;
    res = getResourceForPath(fileSystemForm.getLaunchSession(), request, response, path);
    fwd = checkMount(res, mapping, fileSystemForm, request);
    if (fwd != null) {
      return fwd;
    }
    try {
      res.makeCollection();
      fileSystemForm.setPath(path);
      if (res.getMount().getStore().getProvider().isFireEvents()) {
        CoreServlet.getServlet().fireCoreEvent(NetworkPlaceResourceType.getResourceAccessMkDirEvent(this,
          fileSystemForm.getLaunchSession(),
          request,
          fileSystemForm.getPath(),
          fileSystemForm.getFullURI(),
          null));
      }

    } catch (DAVException e) {
      if (res.getMount().getStore().getProvider().isFireEvents()) {
        CoreServlet.getServlet().fireCoreEvent(NetworkPlaceResourceType.getResourceAccessMkDirEvent(this,
          fileSystemForm.getLaunchSession(),
          request,
          fileSystemForm.getPath(),
          fileSystemForm.getFullURI(),
          e));
      }
      if (e.getStatus() == 405) {
        ActionMessages msgs = getErrors(request);
        msgs.add(Globals.ERROR_KEY, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY, "vfs.folder.exists", fileSystemForm.getNewFolder()));
        saveErrors(request, msgs);
        return mapping.findForward("list");
      } else if (e.getStatus() == 507) {
              ActionMessages msgs = getErrors(request);
              msgs.add(Globals.ERROR_KEY, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY, "vfs.folder.not.allowed", fileSystemForm.getNewFolder()));
              saveErrors(request, msgs);
              return mapping.findForward("list");
          } else {
        throw e;
      }
View Full Code Here

   * @return <code>ActionForward<code> The result of the action.
   * @throws Exception if aan exception is thrown.
   */
  public ActionForward showMkDir(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          throws Exception {
    FileSystemForm fileSystemForm = (FileSystemForm) form;
    checkLaunchSession(request, response, fileSystemForm);
    ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
    if (fwd != null) {
      return fwd;
    }
View Full Code Here

   * @return <code>ActionForward<code> The result of the action.
   * @throws Exception if aan exception is thrown.
   */
  public ActionForward showRenameFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
    FileSystemForm fileSystemForm = (FileSystemForm) form;

    try {
      checkLaunchSession(request, response, fileSystemForm);
      ActionForward fwd = checkAccess(mapping, fileSystemForm, request);
      if (fwd != null) {
        return fwd;
      }
      fileSystemForm.setNewName(DAVUtilities.stripTrailingSlash(fileSystemForm.getFileName()));
      return mapping.findForward("showRenameFile");
    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
      return null;
    }
View Full Code Here

   */
  public ActionForward home(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);
      return new ActionForward(mapping.getPath() + ".do?actionTarget=list&path=" + res.getMount().getMountString() + "&" + LaunchSession.LAUNCH_ID + "=" + fileSystemForm.getLaunchId(), true);

    } catch (DAVAuthenticationRequiredException e) {
      AbstractHTTPAuthenticationModule.sendAuthorizationError(request, response, e.getHttpRealm());
      return null;
    }
View Full Code Here

TOP

Related Classes of com.adito.networkplaces.forms.FileSystemForm

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.