1 16 package org.outerj.daisy.frontend.editor; 17 18 import org.outerj.daisy.repository.PartDataSource; 19 20 import java.io.InputStream ; 21 import java.io.IOException ; 22 23 public class UploadPartDataSource implements PartDataSource { 24 private final org.apache.cocoon.servlet.multipart.Part part; 25 26 public UploadPartDataSource(org.apache.cocoon.servlet.multipart.Part part) { 27 this.part = part; 28 } 29 30 public InputStream createInputStream() throws IOException { 31 try { 35 return part.getInputStream(); 36 } catch (Exception e) { 37 throw new RuntimeException ("Error getting upload input stream.", e); 38 } 39 } 40 41 public long getSize() { 42 return part.getSize(); 43 } 44 45 } 46 | Popular Tags |