Examples of BinaryFactory


Examples of org.jboss.dna.graph.property.BinaryFactory

                            if (mimeType == null) mimeType = DEFAULT_MIME_TYPE;
                            addProperty(properties, factory, JcrLexicon.MIMETYPE, mimeType);

                            if (os.toByteArray().length > 0) {
                                // Now put the file's content into the "jcr:data" property ...
                                BinaryFactory binaryFactory = getExecutionContext().getValueFactories().getBinaryFactory();
                                addProperty(properties, factory, JcrLexicon.DATA, binaryFactory.create(os.toByteArray()));
                            }
                        }
                    } else {
                        // Determine the corresponding file path for this object ...
                        String filePath = getPathAsString(requestedPath);
View Full Code Here

Examples of org.jboss.dna.graph.property.BinaryFactory

                    // Read the length of the content ...
                    long length = stream.readLong();
                    if (skip) {
                        skippedLargeValues.read(valueFactories, hash, length);
                    } else {
                        BinaryFactory factory = valueFactories.getBinaryFactory();
                        // Look for an already-loaded Binary value with the same hash ...
                        value = factory.find(hash);
                        if (value == null) {
                            // Didn't find an existing large value, so we have to read the large value ...
                            value = largeValues.read(valueFactories, hash, length);
                        }
                    }
View Full Code Here

Examples of org.jboss.dna.graph.property.BinaryFactory

            try {
                switch (this.type) {
                    case PropertyType.STRING:
                        return this.getString().equals(that.getString());
                    case PropertyType.BINARY:
                        BinaryFactory binaryFactory = valueFactories.getBinaryFactory();
                        Binary thisValue = binaryFactory.create(this.value);
                        Binary thatValue = binaryFactory.create(that.value);
                        return thisValue.equals(thatValue);
                    case PropertyType.BOOLEAN:
                        return this.getBoolean() == that.getBoolean();
                    case PropertyType.DOUBLE:
                        return this.getDouble() == that.getDouble();
View Full Code Here

Examples of org.modeshape.jcr.value.BinaryFactory

            try {
                switch (this.type) {
                    case PropertyType.STRING:
                        return this.getString().equals(that.getString());
                    case PropertyType.BINARY:
                        BinaryFactory binaryFactory = factories().getBinaryFactory();
                        BinaryValue thisValue = binaryFactory.create(this.value);
                        BinaryValue thatValue = binaryFactory.create(that.value);
                        return thisValue.equals(thatValue);
                    case PropertyType.BOOLEAN:
                        return this.getBoolean() == that.getBoolean();
                    case PropertyType.DOUBLE:
                        return this.getDouble() == that.getDouble();
View Full Code Here

Examples of org.modeshape.jcr.value.BinaryFactory

            } else if (Double[].class.equals(type)) {
                return type.cast(property.getValuesAsArray(context().getValueFactories().getDoubleFactory()));
            } else if (BigDecimal[].class.equals(type)) {
                return type.cast(property.getValuesAsArray(context().getValueFactories().getDecimalFactory()));
            } else if (InputStream[].class.equals(type)) {
                final BinaryFactory binaryFactory = context().getValueFactories().getBinaryFactory();
                InputStream[] result = property.getValuesAsArray(new Property.ValueTypeTransformer<InputStream>() {
                    @Override
                    public InputStream transform( Object value ) {
                        try {
                            BinaryValue binaryValue = binaryFactory.create(value);
                            return binaryValue.getStream();
                        } catch (RepositoryException e) {
                            throw new RuntimeException(e);
                        }
                    }
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.