Package org.omnifaces.resourcehandler
Class RemappedResource
- java.lang.Object
-
- jakarta.faces.application.ViewResource
-
- jakarta.faces.application.Resource
-
- jakarta.faces.application.ResourceWrapper
-
- org.omnifaces.resourcehandler.RemappedResource
-
- All Implemented Interfaces:
FacesWrapper<Resource>
,Externalizable
,Serializable
- Direct Known Subclasses:
CDNResource
public class RemappedResource extends ResourceWrapper implements Externalizable
ThisResource
implementation remaps the given resource to the given request path.- Since:
- 2.1
- Author:
- Bauke Scholtz
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jakarta.faces.application.Resource
COMPONENT_RESOURCE_KEY
-
-
Constructor Summary
Constructors Constructor Description RemappedResource()
Do not use this constructor.RemappedResource(Resource resource, String requestPath)
Constructs a new resource which remaps the given wrapped resource to the given request path.RemappedResource(String resourceName, String libraryName, String requestPath)
Constructs a new resource which remaps the given requested resource and library name to the given request path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
String
getContentType()
InputStream
getInputStream()
String
getLibraryName()
String
getRequestPath()
String
getResourceName()
Map<String,String>
getResponseHeaders()
URL
getURL()
Resource
getWrapped()
int
hashCode()
void
readExternal(ObjectInput input)
void
setLibraryName(String libraryName)
void
setResourceName(String resourceName)
boolean
userAgentNeedsUpdate(FacesContext context)
void
writeExternal(ObjectOutput output)
-
Methods inherited from class jakarta.faces.application.ResourceWrapper
setContentType
-
-
-
-
Constructor Detail
-
RemappedResource
public RemappedResource()
Do not use this constructor. It's merely there forExternalizable
.
-
RemappedResource
public RemappedResource(Resource resource, String requestPath)
Constructs a new resource which remaps the given wrapped resource to the given request path.- Parameters:
resource
- The resource to be remapped.requestPath
- The remapped request path.
-
RemappedResource
public RemappedResource(String resourceName, String libraryName, String requestPath)
Constructs a new resource which remaps the given requested resource and library name to the given request path.- Parameters:
resourceName
- The requested resource name.libraryName
- The requested library name.requestPath
- The remapped request path.
-
-
Method Detail
-
getWrapped
public Resource getWrapped()
- Specified by:
getWrapped
in interfaceFacesWrapper<Resource>
- Overrides:
getWrapped
in classResourceWrapper
-
getResourceName
public String getResourceName()
- Overrides:
getResourceName
in classResourceWrapper
-
setResourceName
public void setResourceName(String resourceName)
- Overrides:
setResourceName
in classResourceWrapper
-
getLibraryName
public String getLibraryName()
- Overrides:
getLibraryName
in classResourceWrapper
-
setLibraryName
public void setLibraryName(String libraryName)
- Overrides:
setLibraryName
in classResourceWrapper
-
getContentType
public String getContentType()
- Overrides:
getContentType
in classResourceWrapper
-
getRequestPath
public String getRequestPath()
- Overrides:
getRequestPath
in classResourceWrapper
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStream
in classResourceWrapper
- Throws:
IOException
-
getResponseHeaders
public Map<String,String> getResponseHeaders()
- Overrides:
getResponseHeaders
in classResourceWrapper
-
getURL
public URL getURL()
- Overrides:
getURL
in classResourceWrapper
-
userAgentNeedsUpdate
public boolean userAgentNeedsUpdate(FacesContext context)
- Overrides:
userAgentNeedsUpdate
in classResourceWrapper
-
readExternal
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput output) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
-