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:
-
CancellableEventGenericRequestEventBase
-
Constructor Summary
ConstructorsConstructorDescriptionShareFileLoadedEvent(@NotNull Exchange exchange, @NotNull Path path) Creates a new ShareFileLoadedEvent with the specified loaded file. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns thecontentTypeif it is not null, otherwise the content type of the file.@NotNull ExchangeGets theExchangewhich stores the involved request, response and some other data.@NotNull FilegetFile()Gets the loaded file associated with this event.getPath()Gets the loaded file path associated with this event.@Nullable StringDetermines the content type of the current file.voidsetContentType(@Nullable String contentType) Forces the sending of a specific content type.voidSets the loaded file associated with this event.voidSets the loaded file path associated with this event.Methods inherited from class de.craftsblock.craftscore.event.CancellableEvent
isCancelled, setCancelledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.craftsblock.craftsnet.events.requests.GenericRequestEventBase
getRequest, getResponse
-
Constructor Details
-
ShareFileLoadedEvent
Creates a new ShareFileLoadedEvent with the specified loaded file.- Parameters:
exchange- The exchange used by the share to handle its connectionpath- The loaded file path associated with this event.
-
-
Method Details
-
getExchange
Gets theExchangewhich stores the involved request, response and some other data.- Specified by:
getExchangein interfaceGenericRequestEventBase- Returns:
- The
Exchange.
-
getPath
Gets the loaded file path associated with this event.- Returns:
- The loaded file path.
- Since:
- 3.3.5-SNAPSHOT
-
getFile
Gets the loaded file associated with this event.- Returns:
- The loaded file.
-
setPath
Sets the loaded file path associated with this event.- Parameters:
path- The new loaded file path.- Since:
- 3.3.5-SNAPSHOT
-
setFile
Sets the loaded file associated with this event.- Parameters:
file- The new loaded file.
-
getRawContentType
Determines the content type of the current file.- Returns:
- The content type of the file.
-
getContentType
Returns thecontentTypeif it is not null, otherwise the content type of the file.- Returns:
- The content type of the file.
-
setContentType
Forces the sending of a specific content type.- Parameters:
contentType- The content type that should be sent
-