Tabnine Logo
MultiPartForm.getRoot
Code IndexAdd Tabnine to your IDE (free)

How to use
getRoot
method
in
com.logicbus.backend.message.MultiPartForm

Best Java code snippets using com.logicbus.backend.message.MultiPartForm.getRoot (Showing top 3 results out of 315)

origin: anylogic/alogic

/**
 * 处理已上传的文件
 * @param ctx 上下文
 * @param cookies 处理的cookies
 * @param handler 处理器
 */
public void handle(Context ctx,Object cookies,FileItemHandler handler){
  if (fileItems != null && !fileItems.isEmpty()){
    Map<String,Object> result = new HashMap<String,Object>(); // NOSONAR
    
    for (FileItem item:fileItems){
      if (item != null && !item.isFormField()){
        contentLength += item.getSize();
        Map<String,Object> fileResult = new HashMap<String,Object>(); // NOSONAR
        fileResult.put("field", item.getFieldName());
        fileResult.put("name", item.getName());
        fileResult.put("size",item.getSize());
        handler.handle(ctx,cookies,item, fileResult);
        result.put(item.getFieldName(), fileResult);
      }
    }
    
    getRoot().put("files", result);
  }
}
origin: anylogic/alogic

@Override
public void finish(Context ctx, boolean closeStream) {
  Map<String,Object> theRoot = getRoot();
  JsonTools.setString(theRoot, "code", ctx.getReturnCode());
  JsonTools.setString(theRoot, "reason", ctx.getReason());
origin: anylogic/alogic

  @Override
  protected int onJson(Context ctx)  {
    if (script != null){
      MultiPartForm msg = (MultiPartForm) ctx.asMessage(MultiPartForm.class);
      
      LogicletContext logicletContext = new Context.ServantLogicletContext(ctx);
      logicletContext.setObject("$context", ctx);
      logicletContext.SetValue("$service", service);
      logicletContext.setObject("$message", msg);
      try {
        XsObject doc = new JsonObject("root",msg.getRoot());
        script.execute(doc,doc, logicletContext, null);
      }finally{
        logicletContext.removeObject("$context");
        logicletContext.removeObject("$message");
        String keyword = logicletContext.GetValue("$keyword", "");
        if (StringUtils.isNotEmpty(keyword)){
          ctx.setKeyword(keyword);
        }                
      }
    }else{
      ctx.asMessage(MultiPartForm.class);
    }
    return 0;
  }
}
com.logicbus.backend.messageMultiPartFormgetRoot

Javadoc

获取JSON结构的根节点

Popular methods of MultiPartForm

  • getContentType
  • getFileItemFactory
    获取FileItemFactory
  • getFileItems
    获取文件列表

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now