Class ShareFileLoadedEvent

java.lang.Object
de.craftsblock.craftscore.event.Event
de.craftsblock.craftscore.event.CancellableEvent
de.craftsblock.craftsnet.events.requests.shares.ShareFileLoadedEvent
All Implemented Interfaces:
de.craftsblock.craftscore.event.Cancellable, GenericRequestEventBase

public class ShareFileLoadedEvent extends de.craftsblock.craftscore.event.CancellableEvent implements GenericRequestEventBase
Represents an event that is triggered when a share file has been loaded. This event provides information about the loaded file.
Since:
2.3.2-SNAPSHOT
See Also:
  • Constructor Details

    • ShareFileLoadedEvent

      public ShareFileLoadedEvent(@NotNull @NotNull Exchange exchange, @NotNull @NotNull Path path)
      Creates a new ShareFileLoadedEvent with the specified loaded file.
      Parameters:
      exchange - The exchange used by the share to handle its connection
      path - The loaded file path associated with this event.
  • Method Details

    • getExchange

      @NotNull public @NotNull Exchange getExchange()
      Gets the Exchange which stores the involved request, response and some other data.
      Specified by:
      getExchange in interface GenericRequestEventBase
      Returns:
      The Exchange.
    • getPath

      public Path getPath()
      Gets the loaded file path associated with this event.
      Returns:
      The loaded file path.
      Since:
      3.3.5-SNAPSHOT
    • getFile

      @NotNull public @NotNull File getFile()
      Gets the loaded file associated with this event.
      Returns:
      The loaded file.
    • setPath

      public void setPath(@NotNull @NotNull Path path)
      Sets the loaded file path associated with this event.
      Parameters:
      path - The new loaded file path.
      Since:
      3.3.5-SNAPSHOT
    • setFile

      public void setFile(@NotNull @NotNull File file)
      Sets the loaded file associated with this event.
      Parameters:
      file - The new loaded file.
    • getRawContentType

      @Nullable public @Nullable String getRawContentType()
      Determines the content type of the current file.
      Returns:
      The content type of the file.
    • getContentType

      @Nullable public @Nullable String getContentType()
      Returns the contentType if it is not null, otherwise the content type of the file.
      Returns:
      The content type of the file.
    • setContentType

      public void setContentType(@Nullable @Nullable String contentType)
      Forces the sending of a specific content type.
      Parameters:
      contentType - The content type that should be sent