Package com.google.collide.dto.server.DtoServerImpls

Examples of com.google.collide.dto.server.DtoServerImpls.GetFileContentsImpl


      this.provisionEditSession = provisionEditSession;
    }

    @Override
    public void handle(final Message<JsonObject> message) {
      final GetFileContentsImpl request = GetFileContentsImpl.fromJsonString(Dto.get(message));

      // Resolve the resource IDs from the requested path.
      vertx.eventBus().send("tree.getResourceIds",
          new JsonObject().putArray("paths", new JsonArray().addString(request.getPath())),
          new Handler<Message<JsonObject>>() {

            /**
             * Sends the contents of a file to the requester. The files will be served out of the
             * FileEditSession if the contents are being edited, otherwise they will simply be
             * served from disk.
             */
              @Override
            public void handle(Message<JsonObject> event) {
              JsonArray resourceIdArr = event.body.getArray("resourceIds");
              Object[] resourceIds = resourceIdArr.toArray();
              String resourceId = (String) resourceIds[0];

              String currentPath = stripLeadingSlash(request.getPath());
              FileEditSession editSession = editSessions.get(resourceId);

              // Create the DTO for the file contents response. We will build it up later in the
              // method.
              String mimeType = MimeTypes.guessMimeType(currentPath, false);
View Full Code Here

TOP

Related Classes of com.google.collide.dto.server.DtoServerImpls.GetFileContentsImpl

Copyright © 2018 www.massapicom. 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.