Package org.jahia.services.content

Examples of org.jahia.services.content.JCRNodeWrapper.uploadFile()


                        googleDocsServiceFactory.getDocsService(getRequest(), getResponse());
                InputStream content = googleDocsService.downloadFile(uri);
                try {
                    JCRNodeWrapper parent = node.getParent();
                    session.checkout(parent);
                    parent.uploadFile(node.getName(), content, node.getFileContent().getContentType());
                    session.save();
                } finally {
                    IOUtils.closeQuietly(content);
                    String docId = null;
                    if (uri.contains("docId=")) {
View Full Code Here


                    if (zipentry.isDirectory()) {
                        target.createCollection(JCRContentUtils.escapeLocalNodeName(filename));
                    } else {
                        String contentType = JahiaContextLoaderListener.getServletContext().getMimeType(filename);
                        target.uploadFile(filename, zis, contentType);
                    }
                    result = true;
                } /*catch (IOException e) {
                    logger.error("Error when unzipping file", e);
                    if (filename != null) {
View Full Code Here

                        newName = JCRContentUtils.findAvailableNodeName(folder, newName);
                    }

                    FileInputStream convertedStream = new FileInputStream(temp);
                    try {
                        folder.uploadFile(newName, convertedStream, format.getMediaType());
                        logger.info("Converted node " + nodeFact.getPath() + " to type " + format.getMediaType());
                    } finally {
                        IOUtils.closeQuietly(convertedStream);
                    }
                } finally {
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.