Package net.fckeditor.handlers

Examples of net.fckeditor.handlers.ResourceType


    else if (!UtilsFile.isValidPath(context.getCurrentFolderStr()))
      getResponse = GetResponse.getInvalidCurrentFolderError();
    else {
     
      // in contrast to doPost the referrer has to send an explicit type
      ResourceType type = context.getResourceType();
      Command command = context.getCommand();
     
      // check permissions for user action
      if ((command.equals(Command.GET_FOLDERS) || command.equals(Command.GET_FOLDERS_AND_FILES))
          && !RequestCycleHandler.isGetResourcesEnabled(request))
View Full Code Here


    else if (!UtilsFile.isValidPath(context.getCurrentFolderStr()))
      uploadResponse = UploadResponse.getInvalidCurrentFolderError();
    else {

      // call the Connector#fileUpload
      ResourceType type = context.getDefaultResourceType();
      FileItemFactory factory = new DiskFileItemFactory();
      ServletFileUpload upload = new ServletFileUpload(factory);
      try {
        List<FileItem> items = upload.parseRequest(request);
        // We upload just one file at the same time
        FileItem uplFile = items.get(0);
        // Some browsers transfer the entire source path not just the
        // filename
        String fileName = FilenameUtils.getName(uplFile.getName());
        logger.debug("Parameter NewFile: {}", fileName);
        // check the extension
        if (type.isDeniedExtension(FilenameUtils.getExtension(fileName)))
          uploadResponse = UploadResponse.getInvalidFileTypeError();
        // Secure image check (can't be done if QuickUpload)
        else if (type.equals(ResourceType.IMAGE)
            && PropertiesLoader.isSecureImageUploads()
            && !UtilsFile.isImage(uplFile.getInputStream())) {
          uploadResponse = UploadResponse.getInvalidFileTypeError();
        } else {
          String sanitizedFileName = UtilsFile
View Full Code Here

TOP

Related Classes of net.fckeditor.handlers.ResourceType

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.