public class FileServingHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_DEFAULT_NAMESPACE |
| Modifier and Type | Method and Description |
|---|---|
static String |
getBytestreamAliasUrl(String uri,
String filename,
javax.servlet.ServletContext ctx)
Combine the URI and the filename to produce a relative URL for the file
(relative to the context of the webapp).
|
static String |
getBytestreamUri(String path,
javax.servlet.ServletContext ctx)
Take a relative URL (relative to the context of the webapp) and produce
the URI for the file bytestream.
|
public static final String PROPERTY_DEFAULT_NAMESPACE
public static String getBytestreamAliasUrl(String uri, String filename, javax.servlet.ServletContext ctx)
Combine the URI and the filename to produce a relative URL for the file (relative to the context of the webapp). The filename will be URLEncoded as needed.
This should involve stripping the default namespace from the front of the URL, replacing it with the file prefix, and adding the filename to the end.
public static String getBytestreamUri(String path, javax.servlet.ServletContext ctx)
Take a relative URL (relative to the context of the webapp) and produce the URI for the file bytestream.
This should involve removing the filename from the end of the URL, and replacing the file prefix with the default namespace.
null if the URL couldn't be translated.Copyright © 2022. All rights reserved.