# Class ResourceEvent

Object
EventObject
Event
ResourceEvent

All Implemented Interfaces:
  `Serializable`, `Cloneable`

public class ResourceEvent extends Event
Event sent when a resource is loaded or closed. The source of this event are the `ResourceTree` instance on which handlers are registered. The event contains a `File` to the resource opened or closed.

Since:
  1.2
See Also:
  - `ResourceTree​.onResourceLoaded`
  - `ResourceTree​.onResourceClosed`
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class Event

  `ANY, consumed, eventType, NULL_SOURCE_TARGET, target`

  ### Fields inherited from class EventObject

  `source`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<File>`
  `getResourceFile()`
  Returns the path to the resource being opened or closed.

  ### Methods inherited from class Event

  `clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed`

  ### Methods inherited from class EventObject

  `getSource, toString`

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### getResourceFile

    public Optional<File> getResourceFile()
    Returns the path to the resource being opened or closed.
    Returns:
      path to the resource being opened or closed.
    Since:
      1.4