Examples of Base64BinaryValueType


Examples of org.exist.xquery.value.Base64BinaryValueType

      }
      Item inputNode = args[0].itemAt(0);
      exiSerializer.startDocument();
          inputNode.toSAX(context.getBroker(), exiSerializer, new Properties());
          exiSerializer.endDocument();
          return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
    }
    catch(IOException ioex) {
      // TODO - test!
      throw new XPathException(this, ErrorCodes.FODC0002, ioex.getMessage());
    }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

            //some of the abstract code in EXQuery needs to be able to instantiate types.
            //Consider a factory or java.util.ServiceLoader pattern
            if(typedValue instanceof org.exquery.xdm.type.StringTypedValue) {
                value = new StringValue(((org.exquery.xdm.type.StringTypedValue)typedValue).getValue());
            } else if(typedValue instanceof org.exquery.xdm.type.Base64BinaryTypedValue) {
                value = BinaryValueFromInputStream.getInstance(xqueryContext, new Base64BinaryValueType(), ((org.exquery.xdm.type.Base64BinaryTypedValue)typedValue).getValue());
            } else {
                value = (Item)typedValue.getValue();
            }

            if(existDestinationType == value.getType()) {
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

        File file = FileModuleHelper.getFile(inputPath);
   
    try {
            new FileInputStream(file).getFD();

            return(BinaryValueFromFile.getInstance(context, new Base64BinaryValueType(),file));
           
    } catch( MalformedURLException e ) {
      throw new XPathException(this, e )
           
    } catch( IOException e ) {
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

            contentHandler.startDocument();
            inputNode.toSAX(context.getBroker(), contentHandler, new Properties());
            contentHandler.endDocument();

            // return the result
            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
        } catch(SAXException se) {
            throw new XPathException(this, se.getMessage(), se);
        } finally {
            if(adapter != null) {
                adapter.cleanup();
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

       
        try {
            ftp.changeWorkingDirectory(remoteDirectory);
            ftp.setFileType(FTP.BINARY_FILE_TYPE);
           
            result = BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), ftp.retrieveFileStream(fileName));

        } catch(IOException ioe) {
            log.error(ioe.getMessage(), ioe);
        }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

      //get the new scaled image
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      ImageIO.write(bImage, formatName, os);
     
      //return the new scaled image data
      return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(os.toByteArray()));
    }
    catch(Exception e)
    {
      throw new XPathException(this, e.getMessage());
    }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

    }

    @Override
    public void add(final InputStream is) throws HttpClientException {
        try {
            result.add(BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), is));
        } catch(final XPathException xpe) {
            throw new HttpClientException("Unable to add binary value to result:" + xpe.getMessage(), xpe);
        }
    }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

                }
            } */

            final ValueSequence result = new ValueSequence();
            for (final File file : files) {
              result.add(BinaryValueFromFile.getInstance(context, new Base64BinaryValueType(), file));
            }

            return result;
        } else {
            throw new XPathException(this, "Variable $request is not bound to a Request object.");
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

        }
    }

    protected BinaryValue stringToBinary(String str, String encoding) throws XPathException {
        try {
            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(str.getBytes(encoding)));
        } catch(final UnsupportedEncodingException e) {
            throw new XPathException(this, "Unsupported encoding: " + encoding);
        }
    }
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.