Class AbstractWrappedReadableResource

java.lang.Object
com.helger.io.resource.wrapped.AbstractWrappedReadableResource
All Implemented Interfaces:
com.helger.base.io.iface.IHasInputStream, com.helger.base.io.iface.IHasInputStreamAndReader, IReadableResource, IResourceBase, IWrappedReadableResource
Direct Known Subclasses:
GZIPReadableResource

public abstract class AbstractWrappedReadableResource extends Object implements IWrappedReadableResource
A wrapper around a readable resource for InputStream manipulation .
Author:
Philip Helger
  • Constructor Details

    • AbstractWrappedReadableResource

      protected AbstractWrappedReadableResource(@NonNull IReadableResource aBaseResource)
  • Method Details

    • getWrappedReadableResource

      public @NonNull IReadableResource getWrappedReadableResource()
      Specified by:
      getWrappedReadableResource in interface IWrappedReadableResource
      Returns:
      The wrapped resource. May not be null.
    • getResourceID

      public @NonNull String getResourceID()
      Specified by:
      getResourceID in interface IResourceBase
      Returns:
      A non-null resource ID used e.g. for system IDs in XML resolving.
    • getPath

      public @NonNull String getPath()
      Specified by:
      getPath in interface IResourceBase
      Returns:
      The requested path. Never null
    • exists

      public boolean exists()
      Specified by:
      exists in interface IResourceBase
      Returns:
      true if the resource exists, false otherwise.
    • getAsURL

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

      public @Nullable File getAsFile()
      Specified by:
      getAsFile in interface IResourceBase
      Returns:
      the File representation of this resource. May be null if this resource cannot be represented as a file.
    • toString

      public String toString()
      Overrides:
      toString in class Object