Package org.dspace.content

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


        bs.setName(bitstream_name);
        bs.setSource(CC_BS_SOURCE);
        bs.setFormat(format);

        // commit everything
        bs.update();
    }

    /**
     * This helper method wraps a String around a byte array returned from the
     * bitstream method further down
View Full Code Here


                        throw new DAVStatusException(DAV.SC_CONFLICT,
                                "Unacceptable value for logo property.");
                    }
                    Bitstream nbs = this.community.setLogo(bis);
                    nbs.setFormat(bsf);
                    nbs.update();
                }
                else
                {
                    throw new DAVStatusException(DAV.SC_CONFLICT,
                            "No <bitstream> element value found for logo property.");
View Full Code Here

                }
            }

            bs.setName("package.pdf");
            setFormatToMIMEType(context, bs, "application/pdf");
            bs.update();
            if (log.isDebugEnabled())
            {
                log.debug("Created bitstream ID=" + String.valueOf(bs.getID()) + ", parsing...");
            }
View Full Code Here

                // Identify the format
                bf = FormatIdentifier.guessFormat(context, b);
                b.setFormat(bf);

                // Update to DB
                b.update();
                item.update();

                if ((bf != null) && (bf.isInternal()))
                {
                    log.warn("Attempt to upload file format marked as internal system use only");
View Full Code Here

            else
            {
                log.debug("Skipping element: " + me.toString());
            }
        }
        bitstream.update();
    }

    /*----------- Dissemination functions -------------------*/

    public Namespace[] getNamespaces()
View Full Code Here

            bf = FormatIdentifier.guessFormat(context, lbs);
        }
        lbs.setFormat(bf);
        lbs.setName(Constants.LICENSE_BITSTREAM_NAME);
        lbs.setSource(Constants.LICENSE_BITSTREAM_NAME);
        lbs.update();
    }

    /**
     * Find bitstream by its Name, looking in all bundles.
     *
 
View Full Code Here

                {
                    bf = FormatIdentifier.guessFormat(context, bitstream);
                }
                bitstream.setFormat(bf);
            }
            bitstream.update();
        }// end for each manifest file

        for (Iterator<Element> mi = manifestBundleFiles.iterator(); mi
                .hasNext();)
        {
View Full Code Here

        // Create a Bitstream from the METS Manifest's content
        Bitstream manifestBitstream = mdBundle.createBitstream(manifest
                .getMetsAsStream());
        manifestBitstream.setName(METSManifest.MANIFEST_FILE);
        manifestBitstream.setSource(METSManifest.MANIFEST_FILE);
        manifestBitstream.update();

        // Get magic bitstream format to identify manifest.
        String fmtName = getManifestBitstreamFormat();
        if (fmtName == null)
        {
View Full Code Here

        }
        BitstreamFormat manifestFormat = PackageUtils
                .findOrCreateBitstreamFormat(context, fmtName,
                        "application/xml", fmtName + " package manifest");
        manifestBitstream.setFormat(manifestFormat);
        manifestBitstream.update();
    }

    /**
     * Add a Logo to a Community or Collection container object based on a METS
     * Manifest.
 
View Full Code Here

            BitstreamFormat bsFormat = BitstreamFormat.findByMIMEType(context, mimeString);
            if (bsFormat == null) {
              bsFormat = FormatIdentifier.guessFormat(context, newBitstream);
            }
            newBitstream.setFormat(bsFormat);
              newBitstream.update();
             
              targetBundle.addBitstream(newBitstream);
            targetBundle.update();
          }
          else {
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.