Skip to content

Add lastmodified for FileUpload #5566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hks2002 opened this issue May 12, 2025 · 0 comments
Open

Add lastmodified for FileUpload #5566

hks2002 opened this issue May 12, 2025 · 0 comments

Comments

@hks2002
Copy link

hks2002 commented May 12, 2025

/*
 * Copyright 2014 Red Hat, Inc.
 *
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  and Apache License v2.0 which accompanies this distribution.
 *
 *  The Eclipse Public License is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  The Apache License v2.0 is available at
 *  http://www.opensource.org/licenses/apache2.0.php
 *
 *  You may elect to redistribute this code under either of these licenses.
 */

package io.vertx.ext.web;

import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.Future;

/**
 * Represents a file-upload from an HTTP multipart form submission.
 * <p>
 *
 * @author <a href="http://tfox.org">Tim Fox</a>
 */
@VertxGen
public interface FileUpload {

  /**
   * @return the name of the upload as provided in the form submission
   */
  String name();

  /**
   * @return the actual temporary file name on the server where the file was uploaded to.
   */
  String uploadedFileName();

  /**
   * @return the file name of the upload as provided in the form submission
   */
  String fileName();

  /**
   * @return the size of the upload, in bytes
   */
  long size();

  /**
   * @return the content type (MIME type) of the upload
   */
  String contentType();

  /**
   * @return the content transfer encoding of the upload - this describes how the upload was encoded in the form submission.
   */
  String contentTransferEncoding();

  /**
   * @return the charset of the upload
   */
  String charSet();

  /**
   * Try to cancel the file upload.
   *
   * @return {@code true} when the upload was cancelled, {@code false} when the upload is finished and the file is available
   */
  boolean cancel();

  /**
   * Delete the uploaded file on the disk.
   *
   * @return a future signaling when the file has been deleted
   */
  Future<Void> delete();

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant