Package org.alfresco.service.cmr.repository

Examples of org.alfresco.service.cmr.repository.ContentReader


     */
    public byte[] getNodeContent(NodeRef nodeRefer) {
        byte[] data = new byte[bytesize];

        // Reading the node content
        ContentReader contentReader = serviceRegistry.getContentService().getReader(
                nodeRefer, ContentModel.PROP_CONTENT);

        actionedUponContentReader = contentReader;
        InputStream is = contentReader.getContentInputStream();

        // Conver input stream to bytes
        try {
            data = this.converToByteArray(is);
        } catch (IOException e) {
View Full Code Here


        final NodeRef nodeRef = findNodeForResource(resource, targetLocation);
        return nodeRef == null || nodeDiffersFromResource(resource, nodeRef);
    }

    public boolean nodeDiffersFromResource(Resource resource, NodeRef nodeRef) throws IOException {
        final ContentReader reader = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
        if (IOUtils.contentEquals(reader.getContentInputStream(), resource.getInputStream())) {
            logger.debug("Existing repository node ({}) matches resource {}.", nodeRef, resource);
            return false;
        }
        return true;
    }
View Full Code Here

        final String location = String.format("%s/%s", getRepositoryStoreService()
            .getBundleRepositoryLocation(), jarFile.getName());
        if (logger.isDebugEnabled()) {
          logger.debug("Installing Bundle: {}", location);
        }
        final ContentReader reader = getContentService().getReader(jarFile.getNodeRef(),
            ContentModel.PROP_CONTENT);
        final Bundle bundle = getFramework().getBundleContext().installBundle(location,
            reader.getContentInputStream());
        bundles.add(bundle);
      } catch (final Exception e) {
        logger.warn("Error installing Bundle: {}", e.getMessage(), e);
      }
    }
View Full Code Here

TOP

Related Classes of org.alfresco.service.cmr.repository.ContentReader

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.