Package org.dspace.content

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


                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 with
                    //out parsing the xml document.
                }
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 with
                //out parsing the xml document.
            }
        }
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 with
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 with
                                //out parsing the xml document.
View Full Code Here

                }
            }
               
            // Success, bitstream found and the user has access to read it.
            // Store these for later retreval:
            this.bitstreamInputStream = bitstream.retrieve();
            this.bitstreamSize = bitstream.getSize();
            this.bitstreamMimeType = bitstream.getFormat().getMIMEType();
            this.bitstreamName = bitstream.getName();
            if (context.getCurrentUser() == null)
            {
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

                HttpServletResponse response = this.entityProviderManager.getRequestGetter().getResponse();
                ServletOutputStream stream = response.getOutputStream();
                response.setContentType(bst.getFormat().getMIMEType());
                response.addHeader("Content-Disposition", "attachment; filename=" + bst.getName());
                response.setContentLength((int) bst.getSize());
                BufferedInputStream buf = new BufferedInputStream(bst.retrieve());

                int readBytes;
                while ((readBytes = buf.read()) != -1) {
                    stream.write(readBytes);
                }
View Full Code Here

            //UsageEvent ue = new UsageEvent();
           // ue.fire(request, context, AbstractUsageEvent.VIEW,
       //Constants.BITSTREAM, bitstream.getID());

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

            // Set the response MIME type
            response.setContentType(bitstream.getFormat().getMIMEType());

            // Response length
View Full Code Here

                return;
            }
        }
       
        // Pipe the bits
        InputStream is = bitstream.retrieve();
    
    // Set the response MIME type
        response.setContentType(bitstream.getFormat().getMIMEType());

        // Response length
View Full Code Here

                    log.error("Caught an error with intercepting the citation document:" + e.getMessage());
                }

                //End of CitationDocument
            } else {
                this.bitstreamInputStream = bitstream.retrieve();
                this.bitstreamSize = bitstream.getSize();
            }

            this.bitstreamMimeType = bitstream.getFormat().getMIMEType();
            this.bitstreamName = bitstream.getName();
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.