Class BasicStaticFiles
java.lang.Object
org.apache.juneau.rest.staticfile.BasicStaticFiles
- All Implemented Interfaces:
- FileFinder,- StaticFiles
API for retrieving localized static files from either the classpath or file system.
 
 Provides the same functionality as BasicFileFinder but adds support for returning files as HttpResource
 objects with arbitrary headers.
 
See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.juneau.rest.staticfile.StaticFilesStaticFiles.Builder, StaticFiles.Void
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor.BasicStaticFiles(BeanStore beanStore) Constructor.BasicStaticFiles(StaticFiles.Builder builder) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StaticFiles.BuilderCreates a new builder for this object.booleanReturns the contents of the resource with the specified name.Returns the file with the specified name as a string.inthashCode()Resolve the specified path.toString()
- 
Constructor Details- 
BasicStaticFilesConstructor.- Parameters:
- beanStore- The bean store containing injectable beans for this logger.
 
- 
BasicStaticFilesConstructor.- Parameters:
- builder- The builder object.
 
- 
BasicStaticFilesprotected BasicStaticFiles()Constructor.Can be used when subclassing and overriding the resolve(String, Locale)method.
 
- 
- 
Method Details- 
createCreates a new builder for this object.- Parameters:
- beanStore- The bean store to use for creating beans.
- Returns:
- A new builder for this object.
 
- 
resolveResolve the specified path.Subclasses can override this method to provide specialized handling. - Specified by:
- resolvein interface- StaticFiles
- Parameters:
- path- The path to resolve to a static file.
- locale- Optional locale.
- Returns:
- The resource, or null if not found.
 
- 
hashCode
- 
equals
- 
getStreamDescription copied from interface:FileFinderReturns the contents of the resource with the specified name.- Specified by:
- getStreamin interface- FileFinder
- Parameters:
- name- The resource name. See- Class.getResource(String)for format.
- locale- The locale of the resource to retrieve.
 If- null , won't look for localized file names.
- Returns:
- The resolved resource contents, or null if the resource was not found.
- Throws:
- IOException- Thrown by underlying stream.
 
- 
getStringDescription copied from interface:FileFinderReturns the file with the specified name as a string.- Specified by:
- getStringin interface- FileFinder
- Parameters:
- name- The file name.
- locale- The locale of the resource to retrieve.
 If- null , won't look for localized file names.
- Returns:
- The contents of the file as a string. Assumes UTF-8 encoding.
- Throws:
- IOException- If file could not be read.
 
- 
toString
 
-