I am Using GWT SDK 2.4.0 Google appengine 1.6.3
I am trying to create a application where a file is uploaded to external repository.
The max size of file is 5 MB.
With help of formPanel, formupload and servlet i send the file to server.
On server Side this file is send to external repository.
fileName = item.getName();
mimetype = item.getContentType();
int len;
while ((len = stream.read(buffer, 0, buffer.length)) != -1) {
output.write(buffer, 0, len);
}
ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray());
Session session =getSession();
ContentStream contentStream = session.getObjectFactory()
.createContentStream(fileName, output.size(), mimetype, input);
FilenetDocument document = new FilenetDocument(fileName);
Folder folder =getFolderSession();
folder.createDocument(document.addDocumentProperty(),
contentStream, VersioningState.MAJOR);
with this procedure i create document in external repository. and on refresh i can see the file on my GWT client GUI.
Now i want to download the same file from external repository. So on server side i wrote this code (FileUtils.download method for downloading from external repositrry.)
System.out.println(" id " +docId);
FileUtils.download(docId,"C:/FilenetDownload",session); <--line 55
but this gives me Error
PrintStack :
java.lang.NoClassDefFoundError: java.io.FileOutputStream is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at org.apache.chemistry.opencmis.client.util.FileUtils.download(FileUtils.java:241)
at org.apache.chemistry.opencmis.client.util.FileUtils.download(FileUtils.java:263)
at com.filenet.server.CmisFileDownload.doPost(CmisFileDownload.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:60)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:78)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:363)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
Plz Can any one explain what is wrong .. or What should i Do..