Package javax.jcr

Examples of javax.jcr.Binary.dispose()


                compareStream(data, in);
            } finally {
                try { in.close(); } catch (IOException ignore) {}
            }
        } finally {
            bin.dispose();
        }
    }

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


                compareStream(data, in);
            } finally {
                try { in.close(); } catch (IOException ignore) {}
            }
        } finally {
            bin.dispose();
        }
    }

    /**
     * Test the deletion of a property by assigning it a null value, saved from
View Full Code Here

                        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(val);
        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

        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

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

                compareStream(data, in);
            } finally {
                try { in.close(); } catch (IOException ignore) {}
            }
        } finally {
            bin.dispose();
        }
    }

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

                compareStream(data, in);
            } finally {
                try { in.close(); } catch (IOException ignore) {}
            }
        } finally {
            bin.dispose();
        }
    }

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