Package com.helger.io.resourceprovider
Interface IWritableResourceProvider
- All Superinterfaces:
IReadableResourceProvider
- All Known Implementing Classes:
DefaultResourceProvider,FileSystemResourceProvider,WritableResourceProviderChain
@MustImplementEqualsAndHashcode
public interface IWritableResourceProvider
extends IReadableResourceProvider
Resource provider interface for readable and writable resources.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable OutputStreamgetOutputStream(@NonNull String sName, @NonNull com.helger.base.io.EAppend eAppend) Get theOutputStreamspecified by the given name for reading.@NonNull IWritableResourcegetWritableResource(@NonNull String sName) Get the resource specified by the given name for writing.booleansupportsWriting(@Nullable String sName) Check if this resource provider can handle the resource with the passed name.Methods inherited from interface com.helger.io.resourceprovider.IReadableResourceProvider
getInputStream, getReadableResource, supportsReading
-
Method Details
-
supportsWriting
Check if this resource provider can handle the resource with the passed name. If there is no real check on whether your resource provider can handle it, simply returntrue.- Parameters:
sName- The name to check. May benull.- Returns:
trueif the name is notnulland can be handled by this provider,falseotherwise.
-
getWritableResource
Get the resource specified by the given name for writing.- Parameters:
sName- The name of the resource to resolve.- Returns:
- The writable resource. Never
null.
-
getOutputStream
default @Nullable OutputStream getOutputStream(@NonNull String sName, @NonNull com.helger.base.io.EAppend eAppend) Get theOutputStreamspecified by the given name for reading. This method may be called without prior call tosupportsWriting(String).- Parameters:
sName- The name of the resource to resolve.eAppend- Appending mode. May not benull.- Returns:
- The
OutputStream. May benullif the underlying resource does not exist and cannot be created or ifsupportsWriting(String)returnsfalse.
-