Examples of Base64BinaryValueType


Examples of org.exist.xquery.value.Base64BinaryValueType

        {
            GZIPOutputStream gzos = new GZIPOutputStream(baos);
            bin.streamTo(gzos);
            gzos.close();

            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
        }
        catch(IOException ioe)
        {
            throw new XPathException(this, ioe.getMessage());
        }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

            {
                baos.write(b, 0, size);
            }
            baos.flush();
            baos.close();
            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
        }
        catch(IOException ioe)
        {
            throw new XPathException(this, ioe.getMessage());
        }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

                    uncompressedData = ModuleUtils.streamToXML(context, new ByteArrayInputStream(entryData));
                }
                catch(SAXException saxe)
                {
                    if(entryData.length > 0)
                        uncompressedData = BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(entryData));
                }

                //call the entry-data function
                Sequence dataParams[] = new Sequence[4];
                System.arraycopy(filterParams, 0, dataParams, 0, 2);
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

                    if(mimeType != null && !mimeType.isXMLType()) {

                        //binary data
                        try {
                           
                            final BinaryValue binaryValue = BinaryValueFromInputStream.getInstance(binaryValueManager, new Base64BinaryValueType(), is);
                            if(binaryValue != null) {
                                result = new SequenceImpl<BinaryValue>(new BinaryTypedValue(binaryValue));
                            }
                        } catch(final XPathException xpe) {
                            throw new RestXqServiceException(RestXqErrorCodes.RQDY0014, xpe);
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

                        builder.addAttribute( new QName( "type", null, null ), "binary" );
                        builder.addAttribute( new QName( "encoding", null, null ), "Base64Encoded" );

                        BinaryValue binary = null;
                        try {
                            binary = BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), cfis);
                            builder.characters(binary.getStringValue());
                        } finally {
                            // free resources
                            if (binary != null) {
                                binary.destroy(context, null);
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

        return result;
    }

    private BinaryValue extractBinaryEntry(ZipInputStream zis, ZipEntry zipEntry) throws XPathException {
        return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), zis);
    }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

                        geometry = indexWorker.transformGeometry(geometry, sourceCRS, "EPSG:4326");
                        if (isCalledAs("getEPSG4326WKT")) {
                            result = new StringValue(wktWriter.write(geometry));
                        } else if (isCalledAs("getEPSG4326WKB")) {
                            byte data[] = wkbWriter.write(geometry);
                            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(data));
                        } else if (isCalledAs("getEPSG4326MinX")) {
                            result = new DoubleValue(geometry.getEnvelopeInternal().getMinX());
                        } else if (isCalledAs("getEPSG4326MaxX")) {
                            result = new DoubleValue(geometry.getEnvelopeInternal().getMaxX());
                        } else if (isCalledAs("getEPSG4326MinY")) {
                            result = new DoubleValue(geometry.getEnvelopeInternal().getMinY());
                        } else if (isCalledAs("getEPSG4326MaxY")) {
                            result = new DoubleValue(geometry.getEnvelopeInternal().getMaxY());
                        } else if (isCalledAs("getEPSG4326CentroidX")) {
                            result = new DoubleValue(geometry.getCentroid().getX());
                        } else if (isCalledAs("getEPSG4326CentroidY")) {
                            result = new DoubleValue(geometry.getCentroid().getY());
                        } else if (isCalledAs("getEPSG4326Area")) {
                            result = new DoubleValue(geometry.getArea());
                        }
                    } else if (isCalledAs("getWKT")) {
                        result = new StringValue(wktWriter.write(geometry));
                    } else if (isCalledAs("getWKB")) {
                        byte data[] = wkbWriter.write(geometry);
                        return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(data));
                    } else if (isCalledAs("getMinX")) {
                        result = new DoubleValue(geometry.getEnvelopeInternal().getMinX());
                    } else if (isCalledAs("getMaxX")) {
                        result = new DoubleValue(geometry.getEnvelopeInternal().getMaxX());
                    } else if (isCalledAs("getMinY")) {
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

            } else if (rs.getMetaData().getColumnClassName(1).equals(Double.class.getName())) {
                result = new DoubleValue(rs.getDouble(1));
            } else if (rs.getMetaData().getColumnClassName(1).equals(String.class.getName())) {
                result = new StringValue(rs.getString(1));
            } else if (rs.getMetaData().getColumnType(1) == java.sql.Types.BINARY) {
                result = BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(rs.getBytes(1)));
            } else
                throw new SQLException("Unable to make an atomic value from '" + rs.getMetaData().getColumnClassName(1) + "'");   
            if (rs.next()) {
                //Should be impossible
                throw new SQLException("More than one geometry for node " + p);
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

                        } else if (rs.getMetaData().getColumnClassName(1).equals(Double.class.getName())) {
                            result.add(new DoubleValue(rs.getDouble(1)));
                        } else if (rs.getMetaData().getColumnClassName(1).equals(String.class.getName())) {
                            result.add(new StringValue(rs.getString(1)));
                        } else if (rs.getMetaData().getColumnType(1) == java.sql.Types.BINARY) {
                            result.add(BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(rs.getBytes(1))));
                        } else
                            throw new SQLException("Unable to make an atomic value from '" + rs.getMetaData().getColumnClassName(1) + "'");
                    }
                }
            }
View Full Code Here

Examples of org.exist.xquery.value.Base64BinaryValueType

            ByteArrayOutputStream os = new ByteArrayOutputStream();
            ImageIO.write(bImage, formatName, os);

            //return the new croped 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
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.