Examples of GetFileContentsImpl


Examples of com.google.collide.dto.client.DtoClientImpls.GetFileContentsImpl

  private void requestFile(final PathUtil path) {
    delayLoadingMessage(path);
   
    // Fetch the file's contents
    GetFileContentsImpl getFileContents = GetFileContentsImpl.make().setPath(path.getPathString());
    appContext.getFrontendApi().GET_FILE_CONTENTS.send(getFileContents,
        new ApiCallback<GetFileContentsResponse>() {

          @Override
          public void onMessageReceived(GetFileContentsResponse response) {
View Full Code Here

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
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.