Package org.dspace.content

Examples of org.dspace.content.Bitstream.retrieve()


            return false;
        else
        {
            String resource = "depositlicense_"+
                              String.valueOf(licenseBs.getSequenceID())+".txt";
            addRightsStream(licenseBs.retrieve(), resource, "text/plain",
                           DSPACE_DEPOSIT_LICENSE_MDTYPE, amdSec);
            return true;
        }
    }
View Full Code Here


        // License as <rightsMD><mdWrap><binData>base64encoded</binData>...
        Bitstream cc;
       
        if ((cc = CreativeCommons.getLicenseRdfBitstream(item)) != null)
        {
            addRightsStream(cc.retrieve(),
                            (gensym("creativecommons") + ".rdf"),
                            "text/rdf",
                            CREATIVE_COMMONS_LICENSE_MDTYPE, amdSec);
        }
        else if ((cc = CreativeCommons.getLicenseTextBitstream(item)) != null)
View Full Code Here

                            "text/rdf",
                            CREATIVE_COMMONS_LICENSE_MDTYPE, amdSec);
        }
        else if ((cc = CreativeCommons.getLicenseTextBitstream(item)) != null)
        {
            addRightsStream(cc.retrieve(),
                            (gensym("creativecommons") + ".txt"),
                            "text/plain",
                            CREATIVE_COMMONS_LICENSE_MDTYPE, amdSec);
        }
        else
View Full Code Here

            // Response length
            response.setHeader("Content-Length", String.valueOf(bitstream
                    .getSize()));

            // Pipe the bits
            InputStream is = bitstream.retrieve();

            Utils.bufferedCopy(is, response.getOutputStream());
            is.close();
            response.getOutputStream().flush();
        }
View Full Code Here

            return null;
        }

        // create a ByteArrayOutputStream
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        Utils.copy(bs.retrieve(), baos);

        return baos.toByteArray();
    }

    /**
 
View Full Code Here

                        manifestFormat = PackageUtils.findOrCreateBitstreamFormat(context,
                             MANIFEST_BITSTREAM_FORMAT, "application/xml",
                             MANIFEST_BITSTREAM_FORMAT+" package manifest");
                        bs.setFormat(manifestFormat);

                        manifest = METSManifest.create(bs.retrieve(), validate);
                    }
                    else
                    {
                        manifest = METSManifest.create(new PackageUtils.UnclosableInputStream(zip), validate);
                        continue;
View Full Code Here

            throws MetadataValidationException, IOException, SQLException, AuthorizeException
        {
            Bitstream mdbs = getBitstreamForMdRef(mdref);
            if (mdbs == null)
                throw new MetadataValidationException("Failed dereferencing bitstream for mdRef element="+mdref.toString());
            return mdbs.retrieve();
        }
    }

    /**
     * Create a new DSpace item out of a METS content package.
View Full Code Here

                        primary = "\tprimary:true ";
                    }

                    int myPrefix = 1; // only used with name conflict

                    InputStream is = b.retrieve();

                    boolean isDone = false; // done when bitstream is finally
                    // written

                    while (!isDone)
View Full Code Here

            bs.setName("package.pdf");
            setFormatToMIMEType(context, bs, "application/pdf");
            bs.update();
            log.debug("Created bitstream ID="+String.valueOf(bs.getID())+", parsing...");

            crosswalkPDF(context, myitem, bs.retrieve());

            wi.update();
            context.commit();
            success = true;
            log.info(LogManager.getHeader(context, "ingest",
View Full Code Here

            if (pdff == null)
                throw new PackageValidationException("Cannot find BitstreamFormat \""+BITSTREAM_FORMAT_NAME+"\"");
            Bitstream pkgBs = PackageUtils.getBitstreamByFormat(item, pdff, Constants.DEFAULT_BUNDLE_NAME);
            if (pkgBs == null)
                throw new PackageValidationException("Cannot find Bitstream with format \""+BITSTREAM_FORMAT_NAME+"\"");
            Utils.copy(pkgBs.retrieve(), out);
        }
            finally {}
    }

    /**
 
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.