Package javax.jcr

Examples of javax.jcr.Binary.dispose()


        };
        PackageId pid = props.getId();

        // invalidate pid if path is unknown
        if (pid == null || pid.getInstallationPath().equals(ZipVaultPackage.UNKNOWN_PATH)) {
            bin.dispose();
            throw new IOException("Package does not contain a path specification or valid package id.");
        }
        if (!pid.isValid()) {
            throw new RepositoryException("Unable to create package. Illegal package name.");
        }
View Full Code Here


                    def.setState(state);
                }
            }
            return jcrPack;
        } finally {
            bin.dispose();
            if (jcrPack == null) {
                session.refresh(false);
            } else {
                session.save();
            }
View Full Code Here

                if (contentStream != null && contentStream.getMimeType() != null) {
                    contentNode.setProperty(Property.JCR_MIMETYPE, contentStream.getMimeType());
                }
            }
            finally {
                binary.dispose();
            }

            fileNode.getSession().save();
            JcrNode jcrFileNode = create(fileNode);
            if (versioningState == VersioningState.NONE) {
View Full Code Here

                if (contentStream != null && contentStream.getMimeType() != null) {
                    contentNode.setProperty(Property.JCR_MIMETYPE, contentStream.getMimeType());
                }
            }
            finally {
                binary.dispose();
            }

            contentNode.getSession().save();

            if (autoCheckout) {
View Full Code Here

                            dispose = true;
                            blob = getBLOBFileValue(store, b.getStream(), true);
                        }
                    } finally {
                        if (dispose) {
                            b.dispose();
                        }
                    }
                }
                return new InternalValue(blob);
            case PropertyType.BOOLEAN:
View Full Code Here

        case PropertyType.BINARY:
            Binary binary = value.getBinary();
            try {
                return createValue(binary.getStream());
            } finally {
                binary.dispose();
            }
        case PropertyType.BOOLEAN:
            return createValue(value.getBoolean());
        case PropertyType.DATE:
            return createValue(value.getDate());
View Full Code Here

            Binary bin = p.getBinary();
            try {
                //System.out.println(bin.getClass() + "@" + System.identityHashCode(bin));
                bin.read(new byte[1], 0);
            } finally {
                bin.dispose();
            }
        }
    }
}
View Full Code Here

            ValueFactory factory = getSession().getValueFactory();
            Binary binary = factory.createBinary(value);
            try {
                setValue(factory.createValue(binary));
            } finally {
                binary.dispose();
            }
        }
    }

    /**
 
View Full Code Here

            try {
                stream = new FilterInputStream(binary.getStream()) {
                    @Override
                    public void close() throws IOException {
                        super.close();
                        binary.dispose();
                    }
                };
            } finally {
                // Proper cleanup also when binary.getStream() fails
                if (stream == null) {
View Full Code Here

                    }
                };
            } finally {
                // Proper cleanup also when binary.getStream() fails
                if (stream == null) {
                    binary.dispose();
                }
            }
        }
        return stream;
    }
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.