Class PlayerFileUploadEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.ui.PlayerFileUploadEvent
Called when the upload of a
ClientFile is finished, i.e. either the file was uploaded successfully or
the upload failed (see getResult()). Uploads can be started via ClientFile.upload(java.lang.String, long, net.risingworld.api.callbacks.Callback).
If a callback was provided there, the callback receives the same event object before the event is triggered.- See Also:
- Example: Upload a selected file into the plugin folder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe result of an upload. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionlonggetBytes()Gets the number of bytes which were received from the player.getFile()Gets the file which was uploaded (or which should have been uploaded).Gets the result of the upload.Gets the uploaded file on the server.booleanGets whether or not the file was uploaded successfully.Methods inherited from class PlayerEvent
getPlayer
-
Method Details
-
getFile
Gets the file which was uploaded (or which should have been uploaded).- Returns:
- the client file.
-
getResult
Gets the result of the upload.- Returns:
- the result of the upload.
-
isSuccessful
public boolean isSuccessful()Gets whether or not the file was uploaded successfully. Same asgetResult() == Result.Success.- Returns:
- true if the upload was successful, false if not.
-
getTargetFile
Gets the uploaded file on the server.- Returns:
- the uploaded file, or null if the upload was not successful.
-
getBytes
public long getBytes()Gets the number of bytes which were received from the player.- Returns:
- the number of received bytes.
-