Examples of MultiPartHandler


Examples of org.netbeans.lib.uihandler.MultiPartHandler

        if (contentType == null || !contentType.toLowerCase().startsWith("multipart/form-data")) {
            return null;
        }

        RequestFacadeImpl facade = new RequestFacadeImpl(request);
        MultiPartHandler multiReq = new MultiPartHandler(facade, tmpDir.getAbsolutePath(), Utils.getMaxUploadSize());
        try{
            multiReq.parseMultipartUpload();
        }finally{
            facade.getInput().getInputStream().close();
        }

        // the file is uploaded as arguments "logs"
        File appFile = multiReq.getFile("logs"); // NOI18N
        if (appFile == null) {
            return null;
        }
        File result =  move(appFile, Utils.getRootUploadDirPath());

        File messagesFile = multiReq.getFile("messages");
        if (messagesFile != null){
            String messagesRootUploadDir = Utils.getMessagesRootUploadDir();
            String messagesUploadDir = Utils.getUploadDirPath(messagesRootUploadDir, getId(appFile));
            File targetFile = new File(messagesUploadDir, result.getName());
            if (!messagesFile.renameTo(targetFile)) {
                LOG.severe("moving " + messagesFile.getPath() + " to " + targetFile.getPath() + " failed");
            } else {
                LOG.fine("moving " + messagesFile.getPath() + " to " + targetFile.getPath()  + " done");
            }
        }
        moveAdditional(multiReq.getFile("slowness"), appFile, result.getName(), Utils.getSlownessRootUploadDir());
        moveAdditional(multiReq.getFile("heapdump"), appFile, result.getName(), Utils.getHeapRootUploadDir());
       
        return result;
    }
View Full Code Here

Examples of rabbit.handler.MultiPartHandler

        if (getMayFilter ())
      rh.handlerFactory =
          proxy.getHandlerFactory (ct.toLowerCase ());
        if (rh.handlerFactory == null
      && ct.startsWith ("multipart/byteranges"))
      rh.handlerFactory = new MultiPartHandler ();
    }
      }
      if (rh.handlerFactory == null) {              // still null
    rh.handlerFactory = new BaseHandler ();   // fallback...
      }
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.