Class AbstractWrappedReadableResource
- java.lang.Object
-
- com.helger.commons.io.resource.wrapped.AbstractWrappedReadableResource
-
- All Implemented Interfaces:
IHasInputStream,IHasInputStreamAndReader,IReadableResource,IResourceBase,IWrappedReadableResource
- Direct Known Subclasses:
GZIPReadableResource
public abstract class AbstractWrappedReadableResource extends Object implements IWrappedReadableResource
A wrapper around a readable resource forInputStreammanipulation .- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWrappedReadableResource(IReadableResource aBaseResource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()FilegetAsFile()URLgetAsURL()StringgetPath()StringgetResourceID()IReadableResourcegetWrappedReadableResource()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.io.IHasInputStream
getBufferedInputStream, getInputStream
-
Methods inherited from interface com.helger.commons.io.IHasInputStreamAndReader
getBufferedReader, getReader
-
Methods inherited from interface com.helger.commons.io.resource.IReadableResource
getReadableCloneForPath
-
Methods inherited from interface com.helger.commons.io.resource.wrapped.IWrappedReadableResource
isReadMultiple
-
-
-
-
Constructor Detail
-
AbstractWrappedReadableResource
protected AbstractWrappedReadableResource(@Nonnull IReadableResource aBaseResource)
-
-
Method Detail
-
getWrappedReadableResource
@Nonnull public IReadableResource getWrappedReadableResource()
- Specified by:
getWrappedReadableResourcein interfaceIWrappedReadableResource- Returns:
- The wrapped resource. May not be
null.
-
getResourceID
@Nonnull public String getResourceID()
- Specified by:
getResourceIDin interfaceIResourceBase- Returns:
- A non-
nullresource ID used e.g. for system IDs in XML resolving.
-
getPath
@Nonnull public String getPath()
- Specified by:
getPathin interfaceIResourceBase- Returns:
- The requested path. Never
null
-
exists
public boolean exists()
- Specified by:
existsin interfaceIResourceBase- Returns:
trueif the resource exists,falseotherwise.
-
getAsURL
@Nullable public URL getAsURL()
- Specified by:
getAsURLin interfaceIResourceBase- Returns:
- the URL representation of this resource. May be
nullif this resource cannot be represented as an URL.
-
getAsFile
@Nullable public File getAsFile()
- Specified by:
getAsFilein interfaceIResourceBase- Returns:
- the File representation of this resource. May be
nullif this resource cannot be represented as a file.
-
-