Package org.restlet.representation

Examples of org.restlet.representation.Representation.release()


        if (getActualMessage() != null) {
            Representation messageEntity = getActualMessage().getEntity();

            // Release entity
            if (messageEntity != null) {
                messageEntity.release();
            }

            // Callback connector service after sending entity
            ConnectorService connectorService = ConnectorHelper
                    .getConnectorService();
View Full Code Here


                        new User(accessToken, accessToken.toCharArray()));
                request.getClientInfo().setAuthenticated(true);
                auth = true;
            }
            getLogger().info("Before graph release");
            body.release();
            tokenResource.release();
            graphResource.release();
        }
        return auth;
    }
View Full Code Here

                           Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());

                           // avoid thread creation because reading an output representation requires a thread
                           StringWriter sw = new StringWriter();
                           rep.write(sw);
                           rep.release();

                           // TODO: optimize by giving item destination to storage
                           loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
                        } catch (Exception ex) {
                           throw new QueryException("Exception during feed entry generation.",ex);
View Full Code Here

                  Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());

                  // avoid thread creation because reading an output representation requires a thread
                  StringWriter sw = new StringWriter();
                  rep.write(sw);
                  rep.release();
                  loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
               }
              
            }
         }
View Full Code Here

      Representation feedRep = storage.getFeed(fpath,feed.getUUID(),feed.getEntries());
      if (feedRep!=null) {
         OutputStream out = context.startFeedOutput();
         feedRep.write(out);
         context.endFeedOutput();
         feedRep.release();
        
         Iterator<Entry> entries = feed.getEntries();
         while (entries.hasNext()) {
            Entry entry = entries.next();
            Iterator<EntryMedia> resources = entry.getResources();
View Full Code Here

                  throw new IOException("Cannot get media "+media.getName()+" for feed at path "+fpath);
               }
               OutputStream mout = context.startMediaOutput(media);
               mediaRep.write(mout);
               context.endMediaOutput();
               mediaRep.release();
            }
         }
        
         Iterator<Feed> children = feed.getChildren();
         while (children.hasNext()) {
View Full Code Here

               Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());
              
               // avoid thread creation because reading an output representation requires a thread
               StringWriter sw = new StringWriter();
               rep.write(sw);
               rep.release();
               loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
              
            }
         }
      } catch (Exception ex) {
View Full Code Here

            Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());

            // avoid thread creation because reading an output representation requires a thread
            StringWriter sw = new StringWriter();
            rep.write(sw);
            rep.release();
            DocumentLoader loader = new SAXDocumentLoader();
            loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));

         }
      } catch (Exception ex) {
View Full Code Here

         String feedBaseURI = getRequest().getResourceRef().getParentRef().getPath();
         Representation entryRep = app.getEntryRepresentation(feedBaseURI,feed,entry.getUUID());
         // avoid a thread with the entry's output representation
         StringWriter sw = new StringWriter();
         entryRep.write(sw);
         entryRep.release();
         DocumentLoader loader = new SAXDocumentLoader();
         Document doc = loader.load(new StringReader(sw.toString()));
        
         // mark the entry as edited
         Date date = media.getEntry().edited();
View Full Code Here

         String feedBaseURI = getRequest().getResourceRef().getParentRef().getPath();
         Representation entryRep = app.getEntryRepresentation(feedBaseURI,feed,entry.getUUID());
         // avoid a thread with the entry's output representation
         StringWriter sw = new StringWriter();
         entryRep.write(sw);
         entryRep.release();
         DocumentLoader loader = new SAXDocumentLoader();
         Document doc = loader.load(new StringReader(sw.toString()));
        
         // mark the entry as edited
         Date date = media.getEntry().edited();
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.