Examples of JavaObjectValue


Examples of org.exist.xquery.value.JavaObjectValue

        }

        if( respVar.getValue().getItemType() != Type.JAVA_OBJECT ) {
            throw( new XPathException( this, "Variable $response is not bound to an Java object." ) );
        }
        final JavaObjectValue respValue = (JavaObjectValue)respVar.getValue().itemAt( 0 );

        if( !"org.exist.http.servlets.HttpResponseWrapper".equals( respValue.getObject().getClass().getName() ) ) {
            throw( new XPathException( this, signature.toString() + " can only be used within the EXistServlet or XQueryServlet" ) );
        }
        final ResponseWrapper response = (ResponseWrapper)respValue.getObject();

        response.setContentType( "application/zip" );
        response.setHeader("Content-Length", String.valueOf(backupFile.length()));
        try {
            final InputStream  is  = new FileInputStream( backupFile );
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    String name = args[0].itemAt(0).getStringValue();
    if( logger.isDebugEnabled() ) {
      logger.debug("Get/create cache [" + name + "]");
    }
   
    return new JavaObjectValue(Cache.getInstance(name));
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    final Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR);
    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}
    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      final ValueSequence result = new ValueSequence();
      for (final Enumeration<String> e =
        ((RequestWrapper) value.getObject()).getParameterNames();
        e.hasMoreElements();
        ) {
        final String param = e.nextElement();
        result.add(new StringValue(param));
      }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getScheme());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getMethod());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    }

    // get the cookieName to match
    final String cookieName = args[0].getStringValue();

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper)
    {
      final Cookie[] cookies = ((RequestWrapper)value.getObject()).getCookies();
      if(cookies != null)
      {
        for(int c = 0; c < cookies.length; c++)
        {
          if(cookies[c].getName().equals(cookieName))
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
   
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getRemoteHost());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    // get parameters
    final String uploadParamName = args[0].getStringValue();

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
      final RequestWrapper request = (RequestWrapper)value.getObject();
      final List<String> fnames = request.getUploadedFileName(uploadParamName);
      if(fnames == null) {
        return Sequence.EMPTY_SEQUENCE;
      }
      final ValueSequence result = new ValueSequence();
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

                final Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR);
                if(var == null || var.getValue() == null)
                        {throw new XPathException(this, "No request object found in the current XQuery context.");}
                if (var.getValue().getItemType() != Type.JAVA_OBJECT)
                        {throw new XPathException(this, "Variable $request is not bound to an Java object.");}
                final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
                if (value.getObject() instanceof RequestWrapper)
                {
                        final ValueSequence result = new ValueSequence();
                        for (final Enumeration<String> e = ((RequestWrapper) value.getObject()).getHeaderNames(); e.hasMoreElements();)
                        {
                                final String param = e.nextElement();
                                result.add(new StringValue(param));
                        }
                        return result;
View Full Code Here

Examples of org.exist.xquery.value.JavaObjectValue

    if(var == null || var.getValue() == null)
      {throw new XPathException(this, "No request object found in the current XQuery context.");}
    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
            final String path = ((RequestWrapper) value.getObject()).getPathInfo();
            return new StringValue(path == null ? "" : path);
        } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
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.