public class DefaultResourceProvider extends Object implements ResourceProvider
ResourceProvider
.Constructor and Description |
---|
DefaultResourceProvider() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Delete all files in the filesystem at the location described in
ResourceProvider.targetOut(String) |
boolean |
contains(String fileName)
Whether or not the filesystem contains the file at the destination described in
ResourceProvider.targetOut(String) |
protected File |
determineCacheResourceDir() |
boolean |
resourceAvailable(String fileName)
Whether or not the classpath contains the resource at the destination described in
ResourceProvider.targetIn(String) |
InputStream |
targetIn(String fileName)
For the filename, provide an InputStream from which to read the file.
|
OutputStream |
targetOut(String fileName)
For the filename, provide a OutputStream to write the file to.
|
public OutputStream targetOut(String fileName)
ResourceProvider
resources/cache
directory of the current application.targetOut
in interface ResourceProvider
fileName
- The name of the file to writepublic InputStream targetIn(String fileName)
ResourceProvider
resources/cache
.targetIn
in interface ResourceProvider
fileName
- The name of the resource to fetchpublic boolean resourceAvailable(String fileName)
ResourceProvider
ResourceProvider.targetIn(String)
resourceAvailable
in interface ResourceProvider
fileName
- The name of the resource to checkpublic boolean contains(String fileName)
ResourceProvider
ResourceProvider.targetOut(String)
contains
in interface ResourceProvider
fileName
- The name of the file to checkpublic void clear()
ResourceProvider
ResourceProvider.targetOut(String)
clear
in interface ResourceProvider
protected File determineCacheResourceDir()
Copyright © 2021. All rights reserved.