Package org.dspace.content

Examples of org.dspace.content.BitstreamFormat


            DAVResource resource) throws AuthorizeException, SQLException,
            IOException
    {
        Element b = new Element("bitstream", DAV.NS_DSPACE);
        long length = bitstream.getSize();
        BitstreamFormat bf = bitstream.getFormat();

        if (length > BITSTREAM_INLINE_THRESHOLD)
        {
            Element e = new Element("link", DAV.NS_DSPACE);
            e.setAttribute("href", resource.hrefPrefix() + "retrieve_"
                    + String.valueOf(bitstream.getID()));
            b.addContent(e);
        }
        else
        {
            Element e = new Element("content", DAV.NS_DSPACE);
            if (bf != null)
            {
                e.setAttribute("contenttype", bf.getMIMEType());
            }
            e.setAttribute("contentlength", String.valueOf(length));
            e.setAttribute("contentencoding", "base64");
            b.addContent(e);
View Full Code Here


      ByteArrayInputStream OREStream = new ByteArrayInputStream(OREString.getBytes());

      Bitstream OREBitstream = OREBundle.createBitstream(OREStream);
      OREBitstream.setName("ORE.xml");

      BitstreamFormat bf = FormatIdentifier.guessFormat(ourContext, OREBitstream);
      OREBitstream.setFormat(bf);
      OREBitstream.update();

      OREBundle.addBitstream(OREBitstream);
      OREBundle.update();
View Full Code Here

        {
            value = this.bitstream.getDescription();
        }
        else if (elementsEqualIsh(property, formatProperty))
        {
            BitstreamFormat bsf = this.bitstream.getFormat();
            value = bsf == null ? null : bsf.getShortDescription();
        }
        else if (elementsEqualIsh(property, format_descriptionProperty))
        {
            value = this.bitstream.getFormatDescription();
        }
View Full Code Here

            if (action == DAV.PROPPATCH_REMOVE)
            {
                throw new DAVStatusException(DAV.SC_CONFLICT,
                        "The format property cannot be removed.");
            }
            BitstreamFormat bsf = BitstreamFormat.findByShortDescription(
                    this.context, newValue);
            if (bsf == null)
            {
                throw new DAVStatusException(DAV.SC_CONFLICT,
                        "Cannot set format, no such Bitstream Format: "
View Full Code Here

            DAVResource resource) throws AuthorizeException, SQLException,
            IOException
    {
        Element b = new Element("bitstream", DAV.NS_DSPACE);
        long length = bitstream.getSize();
        BitstreamFormat bf = bitstream.getFormat();

        if (length > BITSTREAM_INLINE_THRESHOLD)
        {
            Element e = new Element("link", DAV.NS_DSPACE);
            e.setAttribute("href", resource.hrefPrefix() + "retrieve_"
                    + String.valueOf(bitstream.getID()));
            b.addContent(e);
        }
        else
        {
            Element e = new Element("content", DAV.NS_DSPACE);
            if (bf != null)
            {
                e.setAttribute("contenttype", bf.getMIMEType());
            }
            e.setAttribute("contentlength", String.valueOf(length));
            e.setAttribute("contentencoding", "base64");
            b.addContent(e);
View Full Code Here

        if (c != null)
        {
            String ctype = c.getAttributeValue("contenttype");
            if (ctype != null)
            {
                BitstreamFormat af[] = BitstreamFormat.findAll(context);
                for (BitstreamFormat element : af)
                {
                    if (ctype.equals(element.getMIMEType()))
                    {
                        return element;
View Full Code Here

                Element bs = prop.getChild("bitstream", DAV.NS_DSPACE);
                if (bs != null)
                {
                    InputStream bis = DAVBitstream.getXmlBitstreamContent(
                            this.context, bs);
                    BitstreamFormat bsf = DAVBitstream.getXmlBitstreamFormat(
                            this.context, bs);
                    if (bis == null || bsf == null)
                    {
                        throw new DAVStatusException(DAV.SC_CONFLICT,
                                "Unacceptable value for logo property.");
View Full Code Here

      throws SQLException, IOException,
            AuthorizeException
    {
        Bundle bundle = getCcBundle(item);
        // set the format
        BitstreamFormat bs_rdf_format = BitstreamFormat.findByShortDescription(context, "RDF XML");
        // set the RDF bitstream
        setBitstreamFromBytes(item, bundle, BSN_LICENSE_RDF, bs_rdf_format, licenseRdf.getBytes());
    }
View Full Code Here

        // get some more information
        String license_text = fetchLicenseText(cc_license_url);
        String license_rdf = fetchLicenseRDF(cc_license_url);
       
        // set the formats
        BitstreamFormat bs_url_format = BitstreamFormat.findByShortDescription(
                context, "License");
        BitstreamFormat bs_text_format = BitstreamFormat.findByShortDescription(
                context, "CC License");
        BitstreamFormat bs_rdf_format = BitstreamFormat.findByShortDescription(
                context, "RDF XML");

        // set the URL bitstream
        setBitstreamFromBytes(item, bundle, BSN_LICENSE_URL, bs_url_format,
                cc_license_url.getBytes());
View Full Code Here

            throws SQLException, IOException, AuthorizeException
    {
        Bundle bundle = getCcBundle(item);

     // set the format
        BitstreamFormat bs_format;
        if (mimeType.equalsIgnoreCase("text/xml"))
        {
          bs_format = BitstreamFormat.findByShortDescription(context, "CC License");
        } else if (mimeType.equalsIgnoreCase("text/rdf")) {
            bs_format = BitstreamFormat.findByShortDescription(context, "RDF XML");
View Full Code Here

TOP

Related Classes of org.dspace.content.BitstreamFormat

Copyright © 2018 www.massapicom. 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.