Class FileSystemResourceProvider
java.lang.Object
com.helger.commons.io.resourceprovider.FileSystemResourceProvider
- All Implemented Interfaces:
IReadableResourceProvider,IWritableResourceProvider
@ThreadSafe
public class FileSystemResourceProvider
extends Object
implements IWritableResourceProvider
Simple resource provider that only uses files.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemResourceProvider(File aBasePath) FileSystemResourceProvider(String sBasePath) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal FilegetReadableResource(String sName) Get the resource specified by the given name for reading.getWritableResource(String sName) Get the resource specified by the given name for writing.inthashCode()final booleansetCanReadRelativePaths(boolean bCanReadRelativePaths) booleansupportsReading(String sName) Check if this resource provider can handle the resource with the passed name.booleansupportsWriting(String sName) Check if this resource provider can handle the resource with the passed name.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.io.resourceprovider.IReadableResourceProvider
getInputStreamMethods inherited from interface com.helger.commons.io.resourceprovider.IWritableResourceProvider
getOutputStream
-
Constructor Details
-
FileSystemResourceProvider
public FileSystemResourceProvider() -
FileSystemResourceProvider
-
FileSystemResourceProvider
-
-
Method Details
-
getBasePath
-
isCanReadRelativePaths
public final boolean isCanReadRelativePaths() -
setCanReadRelativePaths
@Nonnull public final FileSystemResourceProvider setCanReadRelativePaths(boolean bCanReadRelativePaths) -
supportsReading
Description copied from interface:IReadableResourceProviderCheck 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.- Specified by:
supportsReadingin interfaceIReadableResourceProvider- Parameters:
sName- The name to check. May benull.- Returns:
trueif the name is notnulland can be handled by this provider,falseotherwise.
-
supportsWriting
Description copied from interface:IWritableResourceProviderCheck 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.- Specified by:
supportsWritingin interfaceIWritableResourceProvider- Parameters:
sName- The name to check. May benull.- Returns:
trueif the name is notnulland can be handled by this provider,falseotherwise.
-
getReadableResource
Description copied from interface:IReadableResourceProviderGet the resource specified by the given name for reading.- Specified by:
getReadableResourcein interfaceIReadableResourceProvider- Parameters:
sName- The name of the resource to resolve.- Returns:
- The readable resource. Never
null.
-
getWritableResource
Description copied from interface:IWritableResourceProviderGet the resource specified by the given name for writing.- Specified by:
getWritableResourcein interfaceIWritableResourceProvider- Parameters:
sName- The name of the resource to resolve.- Returns:
- The writable resource. Never
null.
-
equals
-
hashCode
public int hashCode() -
toString
-