Examples of MemoryArchive


Examples of org.apache.jackrabbit.vault.fs.io.MemoryArchive

                size = getData().getLength();
            } catch (RepositoryException e) {
                // ignore
            }
            if (size >= 0 && size < 1024*1024) {
                MemoryArchive archive = new MemoryArchive(false);
                InputStream in = getData().getStream();
                try {
                    archive.run(in);
                } catch (Exception e) {
                    throw new IOException("Error while reading stream", e);
                } finally {
                    in.close();
                }
View Full Code Here

Examples of org.apache.jackrabbit.vault.fs.io.MemoryArchive

                size = getData().getLength();
            } catch (RepositoryException e) {
                // ignore
            }
            if (size >= 0 && size < 1024*1024) {
                MemoryArchive archive = new MemoryArchive(false);
                InputStream in = getData().getStream();
                try {
                    archive.run(in);
                } catch (Exception e) {
                    throw new IOException("Error while reading stream", e);
                } finally {
                    in.close();
                }
View Full Code Here

Examples of org.apache.jackrabbit.vault.fs.io.MemoryArchive

     * {@inheritDoc}
     */
    public JcrPackage upload(InputStream in, boolean replace, boolean strict)
            throws RepositoryException, IOException {

        MemoryArchive archive = new MemoryArchive(true);
        InputStreamPump pump = new InputStreamPump(in , archive);

        // this will cause the input stream to be consumed and the memory archive being initialized.
        Binary bin = session.getValueFactory().createBinary(pump);
        if (pump.getError() != null) {
            Exception error = pump.getError();
            log.error("Error while reading from input stream.", error);
            bin.dispose();
            throw new IOException("Error while reading from input stream", error);
        }

        if (archive.getJcrRoot() == null) {
            String msg = "Stream is not a content package. Missing 'jcr_root'.";
            log.error(msg);
            bin.dispose();
            throw new IOException(msg);
        }

        final MetaInf inf = archive.getMetaInf();
        PackagePropertiesImpl props = new PackagePropertiesImpl() {
            @Override
            protected Properties getPropertiesMap() {
                return inf.getProperties();
            }
View Full Code Here

Examples of org.ow2.util.archive.impl.MemoryArchive

     * @throws DeployableMetadataException if metadata issue
     * @throws ResolverException if resolve fails
     */
    @BeforeClass
    public void init() throws ScanException, DeployableMetadataException, DeployableHelperException, ResolverException {
        MemoryArchive memoryArchive = new MemoryArchive();
        memoryArchive.addClassResource(getClass().getClassLoader(), Arrays.asList(MyEjb.class.getName(), WebserviceSLSB.class.getName()));
        memoryArchive.addResource("META-INF/easybeans.xml", TestMetadata.class.getResource("test-ws-easybeans.xml"));

        EasyBeansEjbJarDeployableFactory deployableFactory = new EasyBeansEjbJarDeployableFactory();
        this.ejbJarAnnotationMetadata = deployableFactory.createDeployableMetadata(EJB3Deployable.class.cast(DeployableHelper.getDeployable(memoryArchive)));

        // ResolverHelper.resolve(this.ejbJarAnnotationMetadata);
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.