Package org.dspace.content

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


            return null;
        }

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

        return baos.toByteArray();
    }

    /**
 
View Full Code Here


                }
                ze.setSize(logoBs.getSize());
                //Set a default modified date so that checksum of Zip doesn't change if Zip contents are unchanged
                ze.setTime(DEFAULT_MODIFIED_DATE);
                zip.putNextEntry(ze);
                Utils.copy(logoBs.retrieve(), zip);
                zip.closeEntry();
            }
        }
    }
View Full Code Here

            Bitstream lbs = element.getBitstreamByName("license.txt");
            if (lbs != null)
            {
                ByteArrayOutputStream baos = new ByteArrayOutputStream(
                        (int) lbs.getSize());
                Utils.copy(lbs.retrieve(), baos);
                return baos.toString();
            }
        }
        return null;
    }
View Full Code Here

                       
                        XMLReader reader = XMLReaderFactory.createXMLReader();
                        reader.setContentHandler(filter);
                        reader.setProperty("http://xml.org/sax/properties/lexical-handler", filter);
                        try {
                                InputStream is = bitstream.retrieve();
                                reader.parse(new InputSource(is));
                        }
                        catch (AuthorizeException ae)
                        {
                                // just ignore the authorize exception and continue on
View Full Code Here

                       
                       
                        XMLReader reader = XMLReaderFactory.createXMLReader();
                        reader.setContentHandler(filter);
                        reader.setProperty("http://xml.org/sax/properties/lexical-handler", filter);
                        reader.parse(new InputSource(bitstream.retrieve()));
                }
                        catch (AuthorizeException ae)
                        {
                                // just ignore the authorize exception and continue on
                                // without parsing the xml document.
View Full Code Here

            if (log.isDebugEnabled())
            {
                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

        FileOutputStream out = null;
        try
        {
            //open up output stream to copy bitstream to file
            out = new FileOutputStream(pkgFile);
            Utils.copy(pkgBs.retrieve(), out);
        }
        finally
        {
            if (out != null)
            {
View Full Code Here

        if (dso.getType() == Constants.ITEM)
        {
            Bitstream cc = CreativeCommons.getLicenseRdfBitstream((Item)dso);
            if (cc != null)
            {
                Utils.copy(cc.retrieve(), out);
                out.close();
            }
        }
    }
View Full Code Here

        {
            Bitstream licenseBs = PackageUtils.findDepositLicense(context, (Item)dso);
            
            if (licenseBs != null)
            {
                Utils.copy(licenseBs.retrieve(), out);
                out.close();
            }
        }
    }
View Full Code Here

        if (dso.getType() == Constants.ITEM)
        {
            Bitstream cc = CreativeCommons.getLicenseTextBitstream((Item)dso);
            if (cc != null)
            {
                Utils.copy(cc.retrieve(), out);
                out.close();
            }
        }
    }
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.