Package org.structr.websocket.command

Examples of org.structr.websocket.command.FileUploadHandler


  // ----- file handling -----
  public void createFileUploadHandler(FileBase file) {

    String uuid = file.getProperty(GraphObject.id);

    uploads.put(uuid, new FileUploadHandler(file));

  }
View Full Code Here


  }

  private FileUploadHandler handleExistingFile(final String uuid) {

    FileUploadHandler newHandler = null;

    try {

      File file = (File) StructrApp.getInstance(securityContext).get(uuid);

      if (file != null) {

        newHandler = new FileUploadHandler(file);

        //uploads.put(uuid, newHandler);
      }

    } catch (FrameworkException ex) {
View Full Code Here

  }

  public void handleFileChunk(final String uuid, final int sequenceNumber, final int chunkSize, final byte[] data, final int chunks) throws IOException {

    FileUploadHandler upload = uploads.get(uuid);

    if (upload == null) {

      upload = handleExistingFile(uuid);
    }

    if (upload != null) {

      upload.handleChunk(sequenceNumber, chunkSize, data, chunks);

    }

  }
View Full Code Here

TOP

Related Classes of org.structr.websocket.command.FileUploadHandler

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.