Interface IResourceBase

All Known Subinterfaces:
IMemoryReadableResource, IReadableResource, IReadWriteResource, IWrappedReadableResource, IWrappedWritableResource, IWritableResource
All Known Implementing Classes:
AbstractMemoryReadableResource, AbstractWrappedReadableResource, AbstractWrappedWritableResource, ClassPathResource, FileSystemResource, GZIPReadableResource, GZIPWritableResource, ReadableResourceByteArray, ReadableResourceInputStream, ReadableResourceString, URLResource

@MustImplementEqualsAndHashcode public interface IResourceBase
Base interface for an abstract readable resource.
Author:
Philip Helger
  • Method Details

    • getResourceID

      @Nonnull String getResourceID()
      Returns:
      A non-null resource ID used e.g. for system IDs in XML resolving.
    • getPath

      @Nonnull String getPath()
      Returns:
      The requested path. Never null
    • exists

      boolean exists()
      Returns:
      true if the resource exists, false otherwise.
    • getAsURL

      @Nullable URL getAsURL()
      Returns:
      the URL representation of this resource. May be null if this resource cannot be represented as an URL.
    • getAsFile

      @Nullable File getAsFile()
      Returns:
      the File representation of this resource. May be null if this resource cannot be represented as a file.