Class StreamableResourceFactory
java.lang.Object
org.apache.creadur.whisker.app.load.StreamableResourceFactory
Conveniently builds
StreamableResource
implementations.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBuilds instance that streams, on demand, from resource on the class path.streamFromFileResource
(File file) Builds instance that streams, on demand, from resource stored in the file system.streamFromFileResource
(String fileName) Builds instance that streams, on demand, from resource stored in the file system.streamFromResource
(String resourceName) When the resource is found on the classpath, builds an instance that streams, on demand, from the classpath.
-
Constructor Details
-
StreamableResourceFactory
public StreamableResourceFactory()
-
-
Method Details
-
streamFromClassPathResource
Builds instance that streams, on demand, from resource on the class path.- Parameters:
name
- full name, including path, of the resource not null- Returns:
- an instance that streams, on demand, the given resource, not null
-
streamFromFileResource
Builds instance that streams, on demand, from resource stored in the file system.- Parameters:
fileName
- full name, including path, of the resource not null- Returns:
- an instance that streams, on demand, the given resource, not null
-
streamFromFileResource
Builds instance that streams, on demand, from resource stored in the file system.- Parameters:
file
- a file storing the resource not null- Returns:
- an instance that streams, on demand, the given resource, not null
-
streamFromResource
When the resource is found on the classpath, builds an instance that streams, on demand, from the classpath. Otherwise, builds an instances that streams from the file system.- Parameters:
resourceName
- source stream name.- Returns:
- not null
-