Package org.apache.roller.model

Examples of org.apache.roller.model.FileManager.saveFile()


                        fileSize = files[i].getFileSize();

                        //retrieve the file data
                        if (fmgr.canSave(website.getHandle(), fileName, fileSize, rollerMessages)) {
                            InputStream stream = files[i].getInputStream();
                            fmgr.saveFile(website.getHandle(), fileName, fileSize, stream);
                            lastUploads.add(fileName);
                        }
                       
                        //destroy the temporary file created
                        files[i].destroy();
View Full Code Here


        FileManager fmgr = RollerFactory.getRoller().getFileManager();
        RollerMessages msgs = new RollerMessages();
       
        // store a file
        InputStream is = getClass().getResourceAsStream("/bookmarks.opml");
        fmgr.saveFile(testWeblog.getHandle(), "bookmarks.opml", 1545, is);
       
        // make sure file was stored successfully
        assertEquals(1, fmgr.getFiles(testWeblog.getHandle()).length);
       
        // delete a file
View Full Code Here

            RollerMessages msgs = new RollerMessages();
           
            // If save is allowed by Roller system-wide policies
            if (fmgr.canSave(website.getHandle(), name, bits.length, msgs)) {
                // Then save the file
                fmgr.saveFile(
                        website.getHandle(), name, bits.length, new ByteArrayInputStream(bits));
               
                RollerRequest rreq = RollerRequest.getRollerRequest();
                HttpServletRequest request = rreq.getRequest();
               
View Full Code Here

               
                // If save is allowed by Roller system-wide policies
                if (fmgr.canSave(website.getHandle(), name, tempFile.length(), msgs)) {
                    // Then save the file
                    FileInputStream fis = new FileInputStream(tempFile);
                    fmgr.saveFile(website.getHandle(), name, tempFile.length(), fis);
                    fis.close();
                   
                    File resource = new File(fmgr.getUploadDir() + File.separator + name);
                    return createAtomResourceEntry(website, resource);
                }
View Full Code Here

        FileManager fmgr = RollerFactory.getRoller().getFileManager();
        RollerMessages msgs = new RollerMessages();
       
        // store a file
        InputStream is = getClass().getResourceAsStream("/bookmarks.opml");
        fmgr.saveFile(testWeblog.getHandle(), "bookmarks.opml", "text/plain", 1545, is);
       
        // make sure file was stored successfully
        assertEquals(1, fmgr.getFiles(testWeblog.getHandle()).length);
       
        // delete a file
View Full Code Here

            RollerMessages msgs = new RollerMessages();
           
            // If save is allowed by Roller system-wide policies
            if (fmgr.canSave(website.getHandle(), name, type, bits.length, msgs)) {
                // Then save the file
                fmgr.saveFile(website.getHandle(), name, type, bits.length, new ByteArrayInputStream(bits));
               
                // TODO: build URL to uploaded file should be done in FileManager
                String uploadPath = RollerFactory.getRoller().getFileManager().getUploadUrl();
                uploadPath += "/" + website.getHandle() + "/" + name;
                String fileLink = URLUtilities.getWeblogResourceURL(website, name, true);
View Full Code Here

                    // If save is allowed by Roller system-wide policies
                    if (fmgr.canSave(website.getHandle(), fileName, contentType, tempFile.length(), msgs)) {
                        // Then save the file
                        FileInputStream fis = new FileInputStream(tempFile);
                        fmgr.saveFile(website.getHandle(), fileName, contentType, tempFile.length(), fis);
                        fis.close();

                        File resource = new File(fmgr.getUploadDir() + File.separator + fileName);
                        return createAtomResourceEntry(website, resource);
                    }
View Full Code Here

                       
                        //retrieve the file data
                        if (fmgr.canSave(website.getHandle(), fileName,
                                files[i].getContentType(), fileSize, rollerMessages)) {
                            InputStream stream = files[i].getInputStream();
                            fmgr.saveFile(website.getHandle(), fileName,
                                    files[i].getContentType(), fileSize, stream);
                            lastUploads.add(fileName);
                        }
                       
                        //destroy the temporary file created
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.