Package javax.jcr

Examples of javax.jcr.Binary.dispose()


                        in2.close();
                    } catch (IOException ignore) {}
                }
            }
        } finally {
            bin.dispose();
        }
    }

    /**
     * Tests the failure of calling Property.getStream() on a multivalue
View Full Code Here


                try {
                    in2.close();
                } catch (IOException ignore) {}
            }
        } finally {
            bin.dispose();
        }
    }

    /**
     * Tests conversion from Binary type to Boolean type. This is done via
View Full Code Here

        Binary binary = val.getBinary();
        long length;
        try {
            length = binary.getSize();
        } finally {
            binary.dispose();
        }
        long bytes = PropertyUtil.countBytes(prop.getValue());
        if (bytes != -1) {
            assertEquals("Binary.getSize() returns wrong number of bytes.",
                    bytes, length);
View Full Code Here

                assertEquals("unexpected result of Value.getBinary.read()", content[content.length - 1], buf[0]);
                assertTrue("unexpected result of Value.getBinary.read()", -1 != bin.read(buf, 0));
                assertEquals("unexpected result of Value.getBinary.read()", content[0], buf[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

        final Binary bin = getValue().getBinary();
        // make sure binary is disposed after stream had been consumed
        return new AutoCloseInputStream(bin.getStream()) {
            public void close() throws IOException {
                super.close();
                bin.dispose();
            }
        };
    }

    public long getLong() throws RepositoryException {
View Full Code Here

                compareStream(data, in);
            } finally {
                in.close();
            }
        } finally {
            bin.dispose();
        }
    }

    /**
     * Test the persistence of a property modified with an input stream
View Full Code Here

                compareStream(data, in);
            } finally {
                in.close();
            }
        } finally {
            bin.dispose();
        }
    }

    /**
     * Test the deletion of a property by assigning it a null value, saved from
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

            content.setProperty(Property.JCR_LAST_MODIFIED, date);
            content.setProperty(Property.JCR_DATA, binary);
            return file;
        } finally {
            binary.dispose();
        }
    }

    /**
     * Returns a string representation of the given item. The returned string
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.