TODO
@param url
@param action
@return
326589
public EngineResult postEngineRequest(String url, String action) {
        HttpPost postRequest = new HttpPost(url);
        StringEntity postEntity = null;
        try {
            postEntity = new StringEntity(action);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        postEntity.setContentType("application/x-www-form-urlencoded");
        postRequest.addHeader("Accept", "application/xml");
        postRequest.setEntity(postEntity);
        return engineResult(postRequest);
    }
1164680
public RequestBuilder request(HttpMethod method, String url) {
        return request(method.asString(), url);
    }
610982
protected boolean routingToAction(HttpServletRequest request, HttpServletResponse response, String contextPath, String requestPath,
            String actionName, String paramPath, ActionExecute execByParam) throws IOException, ServletException {
        if (execByParam != null) { // already found
            processAction(request, response, execByParam, paramPath); // #to_action
            return true;
        }
        final OptionalThing<ActionExecute> found = LaActionExecuteUtil.findActionExecute(actionName, request);
        if (found.isPresent()) { // not use lambda because of throws definition
            final ActionExecute execute = found.get();
            if (needsTrailingSlashRedirect(request, requestPath, execute)) { // index() or by request parameter
                redirectWithTrailingSlash(request, response, contextPath, requestPath);
            } else {
                processAction(request, response, execute, null); // #to_action
            }
            return true;
        } else { // e.g. not found index()
            return false;
        }
    }
896024
protected Action toAction(Object item) {
        if (item instanceof Action) {
            return (Action) item;
        } else if (item instanceof String) {
            final String definition = (String) item;
            return new DefaultAction(
                definition + "@" + RANDOM.nextInt(),
                resolveDataFunction((String) item),
                getMiddleware(definition)
            );
        } else {
            String name;
            List<Middleware> middleware;
            try {
                name = (String) ClassApi
                    .findMethod(item.getClass(), "getName")
                    .invoke(item);
                middleware = getMiddleware(name);
            } catch (Throwable t) {
                name  = item.getClass().getName();
                middleware = Collections.emptyList();
            }
            return new DefaultAction(
                name + "@" + RANDOM.nextInt(),
                getDataFunctionExtractor().apply(item, DEFAULT_FUNCTION),
                middleware
            );
        }
    }
1127276
void executeAction( Action action ) throws PluginException {

		try {
			switch( action.actionType ) {
			case DELETE:
				this.logger.fine( "Deleting " + action.parameter + "..." );
				File f = new File( action.parameter );
				Utils.deleteFilesRecursively( f );
				break;

			case DOWNLOAD:
				this.logger.fine( "Downloading " + action.parameter + "..." );
				URI uri = UriUtils.urlToUri( action.parameter );
				File targetFile = new File( System.getProperty( "java.io.tmpdir" ), TMP_FILE );
				InputStream in = null;
				try {
					in = uri.toURL().openStream();
					Utils.copyStream( in, targetFile );

				} finally {
					Utils.closeQuietly( in );
				}

				break;

			case MOVE:
				List<String> parts = Utils.splitNicely( action.parameter, "->" );
				if( parts.size() != 2 ) {
					this.logger.warning( "Invalid syntax for 'move' action. " + action.parameter );
				} else {
					File source = new File( parts.get( 0 ));
					File target = new File( parts.get( 1 ));
					this.logger.fine( "Moving " + source + " to " + target + "..." );
					if( ! source.renameTo( target ))
						throw new IOException( source + " could not be moved to " + target );
				}

				break;

			case COPY:
				parts = Utils.splitNicely( action.parameter, "->" );
				if( parts.size() != 2 ) {
					this.logger.warning( "Invalid syntax for 'copy' action. " + action.parameter );
				} else {
					File source = new File( parts.get( 0 ));
					File target = new File( parts.get( 1 ));
					this.logger.fine( "Copying " + source + " to " + target + "..." );
					Utils.copyStream( source, target );
				}

				break;

			default:
				this.logger.fine( "Ignoring the action..." );
				break;
			}

		} catch( Exception e ) {
			throw new PluginException( e );
		}
	}
886977
public function create($url, $method, $action)
	{
		return new Route(
			$this->parseUrl($url), 
			$this->parseArguments($url),
			$this->parseMethod($method), 
			$action
		);
	}
108474
function _createAction(action) {
  if (_isString(action)) {
    action = {
      destination: action,
    }
  }
  if (_isObject(action)) {
    action = (function() {
      const openNewTab = action.openNewTab
      const destination = action.destination
      return function() {
        if (openNewTab) {
          window.open(destination, '_blank')
        } else {
          window.location.href = destination
        }
      }
    })()
  }

  return action
}
373740
public static Expectations successfullyReachedUrl(String testAction, String url) {
        Expectations expectations = new Expectations();
        expectations.addSuccessStatusCodesForActions(new String[] { testAction });
        expectations.addExpectation(new ResponseUrlExpectation(testAction, Constants.STRING_EQUALS, url, "Did not reach the expected URL."));
        return expectations;
    }
432374
public static String buildAction(Class<?> clazz, String action) {
        return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
    }
1031506
public ParallelTaskBuilder prepareHttpGet(String url) {
        reinitIfClosed();
        ParallelTaskBuilder cb = new ParallelTaskBuilder();
        
        cb.getHttpMeta().setHttpMethod(HttpMethod.GET);
        cb.getHttpMeta().setRequestUrlPostfix(url);
        
        return cb;
    }
720413
public com.google.iam.v1.BindingDelta.Action getAction() {
    com.google.iam.v1.BindingDelta.Action result = com.google.iam.v1.BindingDelta.Action.valueOf(action_);
    return result == null ? com.google.iam.v1.BindingDelta.Action.UNRECOGNIZED : result;
  }
220742
public void setNameAction(final Action action) {
		LinkComponent linkComponent = new LinkComponent();
		linkComponent.setNameAction(action);
		repeater.setRepeatedComponent(linkComponent);
	}
862059
private boolean checkActionMethod(AppController controller, String actionMethod) {
        HttpMethod method = HttpMethod.getMethod(RequestContext.getHttpRequest());
        if (!controller.actionSupportsHttpMethod(actionMethod, method)) {
            DirectResponse res = new DirectResponse("");
            //see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
            res.setStatus(405);
            LOGGER.warn("Requested action does not support HTTP method: " + method.name() + ", returning status code 405.");
            RequestContext.setControllerResponse(res);

            //TODO: candidate for caching below, list of allowed HTTP methods
            //see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
            RequestContext.getHttpResponse().setHeader("Allow", join(controller.allowedActions(actionMethod), ", "));
            return false;
        }
        return true;
    }
1163821
public static Action resourceContent(URL resourceUrl, Charset charset) {
        final Action charsetAction = charset != null ? charset(charset) : Action.noop();
        return composite(resourceContent(resourceUrl), charsetAction);
    }
877221
public Api getActionResult(String action, String params, TokenResult token,
      Object pFormData, String format) throws Exception {
    String text = this.getActionResultText(action, params, token, pFormData,
        format);
    Api api = null;
    if ("xml".equals(format)) {
      if (debug) {
        // convert the xml to a more readable format
        String xmlDebug = text.replace(">", ">\n");
        LOGGER.log(Level.INFO, xmlDebug);
      }
      if (text.startsWith("<?xml version"))
        api = fromXML(text);
      else {
        LOGGER.log(Level.SEVERE, text);
        throw new Exception("invalid xml:" + text);
      }
    } else if ("json".equals(format)) {
      if (debug) {
        LOGGER.log(Level.INFO,
            text.substring(0, Math.min(240, text.length() - 1)));
      }
      if (gson == null)
        gson = new Gson();
      api = gson.fromJson(text, Api.class);
      api.setRawJson(text);
    } else {
      throw new IllegalStateException("unknown format " + format);
    }
    return api;
  }
744537
private List<NameValuePair> getUrlParameters(String action, String token, String redirectUri) {
        List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
        if (action == "revoke") {
            urlParameters.add(new BasicNameValuePair("token", token));
        } else if (action == "refresh") {
            urlParameters.add(new BasicNameValuePair("refresh_token", token));
            urlParameters.add(new BasicNameValuePair("grant_type", "refresh_token"));
        } else {
            urlParameters.add(new BasicNameValuePair("code", token));
            urlParameters.add(new BasicNameValuePair("redirect_uri", redirectUri));
            urlParameters.add(new BasicNameValuePair("grant_type", "authorization_code"));
        }
        return urlParameters;
    }
763011
private static String getActionString(int action) {

        switch (action) {

            case Constraint.RESTRICT :
                return Tokens.T_RESTRICT;

            case Constraint.CASCADE :
                return Tokens.T_CASCADE;

            case Constraint.SET_DEFAULT :
                return Tokens.T_SET + ' ' + Tokens.T_DEFAULT;

            case Constraint.SET_NULL :
                return Tokens.T_SET + ' ' + Tokens.T_NULL;

            default :
                return Tokens.T_NO + ' ' + Tokens.T_ACTION;
        }
    }