public final class DirectoryBrowserSupport extends Object implements org.kohsuke.stapler.HttpResponse
This object can be used in a mix-in style to provide a directory browsing
capability to a ModelObject.
| Modifier and Type | Class and Description |
|---|---|
static class |
DirectoryBrowserSupport.Path
Represents information about one file or folder.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CSP_VALUE |
hudson.model.ModelObject |
owner |
String |
title |
| Constructor and Description |
|---|
DirectoryBrowserSupport(hudson.model.ModelObject owner,
hudson.FilePath base,
String title,
String icon,
boolean serveDirIndex) |
DirectoryBrowserSupport(hudson.model.ModelObject owner,
String title)
Deprecated.
|
DirectoryBrowserSupport(hudson.model.ModelObject owner,
jenkins.util.VirtualFile base,
String title,
String icon,
boolean serveDirIndex) |
| Modifier and Type | Method and Description |
|---|---|
void |
generateResponse(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
Object node) |
void |
serveFile(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
hudson.FilePath root,
String icon,
boolean serveDirIndex)
Deprecated.
as of 1.297 Instead of calling this method explicitly, just
return the
DirectoryBrowserSupport object from the
doXYZ method and let Stapler generate a response for
you. |
void |
setIndexFileName(String fileName)
If the directory is requested but the directory listing is disabled, a
file of this name is served.
|
public final hudson.model.ModelObject owner
public final String title
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final String DEFAULT_CSP_VALUE
@Deprecated public DirectoryBrowserSupport(hudson.model.ModelObject owner, String title)
DirectoryBrowserSupport(ModelObject, FilePath, String, String, boolean)owner - The parent model object under which the directory browsing is added.title - Used in the HTML caption.public DirectoryBrowserSupport(hudson.model.ModelObject owner,
hudson.FilePath base,
String title,
String icon,
boolean serveDirIndex)
owner - The parent model object under which the directory browsing is
added.base - The root of the directory that's bound to URL.title - Used in the HTML caption.icon - The icon file name, like "folder.gif"serveDirIndex - True to generate the directory index. False to serve
"index.html"public DirectoryBrowserSupport(hudson.model.ModelObject owner,
jenkins.util.VirtualFile base,
String title,
String icon,
boolean serveDirIndex)
owner - The parent model object under which the directory browsing is
added.base - The root of the directory that's bound to URL.title - Used in the HTML caption.icon - The icon file name, like "folder.gif"serveDirIndex - True to generate the directory index. False to serve
"index.html"public void generateResponse(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
Object node)
throws IOException,
javax.servlet.ServletException
generateResponse in interface org.kohsuke.stapler.HttpResponseIOExceptionjavax.servlet.ServletExceptionpublic void setIndexFileName(String fileName)
fileName - - name of the file to use as index@Deprecated public void serveFile(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, hudson.FilePath root, String icon, boolean serveDirIndex) throws IOException, javax.servlet.ServletException, InterruptedException
DirectoryBrowserSupport object from the
doXYZ method and let Stapler generate a response for
you.req - Requestrsp - Responseroot - Server rooticon - The icon file name, like "folder-open.gif"serveDirIndex - True to generate the directory index. False to serve
"index.html"IOException - IOExceptionjavax.servlet.ServletException - ServletExceptionInterruptedException - InterruptedExceptionCopyright © 2016–2021. All rights reserved.