Package com.composum.sling.nodes.tools
Class RuntimeFileServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- com.composum.sling.nodes.tools.RuntimeFileServlet
-
- All Implemented Interfaces:
com.composum.sling.core.service.RestrictedService
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class RuntimeFileServlet extends org.apache.sling.api.servlets.SlingSafeMethodsServlet implements com.composum.sling.core.service.RestrictedService
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuntimeFileServlet.LogfileFilter
static class
RuntimeFileServlet.LoggerSession
static class
RuntimeFileServlet.RuntimeFile
-
Field Summary
Fields Modifier and Type Field Description static Pattern
IS_LOGFILE
static String
PATH_RESTRICTION_PREFIX
protected com.composum.sling.core.service.ServiceRestrictions
restrictions
static String
RUNTIME_ROOT
static String
SA_SESSIONS
static String
SERVICE_KEY
static String
SERVLET_LABEL
static String
SERVLET_PATH
-
Constructor Summary
Constructors Constructor Description RuntimeFileServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
activate()
protected void
doGet(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)
protected void
downloadFile(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @Nullable String suffix)
protected @Nullable RuntimeFileServlet.RuntimeFile
getFile(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String suffix)
protected RuntimeFileServlet.LoggerSession
getLoggerSession(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String path)
com.composum.sling.core.service.ServiceRestrictions.Permission
getPermission()
com.composum.sling.core.service.ServiceRestrictions.Key
getServiceKey()
boolean
isEnabled()
protected void
tailLogfile(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @NotNull String[] selectors, @Nullable String suffix)
protected void
treeNode(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @Nullable String suffix)
protected void
writeFileIdentifiers(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull com.google.gson.stream.JsonWriter writer, @NotNull RuntimeFileServlet.RuntimeFile rtFile)
protected void
writeFileNode(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull com.google.gson.stream.JsonWriter writer, @NotNull RuntimeFileServlet.RuntimeFile rtFile)
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
-
-
-
-
Field Detail
-
SERVICE_KEY
public static final String SERVICE_KEY
- See Also:
- Constant Field Values
-
PATH_RESTRICTION_PREFIX
public static final String PATH_RESTRICTION_PREFIX
- See Also:
- Constant Field Values
-
SERVLET_LABEL
public static final String SERVLET_LABEL
- See Also:
- Constant Field Values
-
SERVLET_PATH
public static final String SERVLET_PATH
- See Also:
- Constant Field Values
-
IS_LOGFILE
public static final Pattern IS_LOGFILE
-
SA_SESSIONS
public static final String SA_SESSIONS
-
RUNTIME_ROOT
public static final String RUNTIME_ROOT
-
restrictions
protected com.composum.sling.core.service.ServiceRestrictions restrictions
-
-
Method Detail
-
activate
protected void activate()
-
getServiceKey
@NotNull public com.composum.sling.core.service.ServiceRestrictions.Key getServiceKey()
- Specified by:
getServiceKey
in interfacecom.composum.sling.core.service.RestrictedService
-
isEnabled
public final boolean isEnabled()
-
getPermission
public final com.composum.sling.core.service.ServiceRestrictions.Permission getPermission()
-
getFile
@Nullable protected @Nullable RuntimeFileServlet.RuntimeFile getFile(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable @Nullable String suffix)
-
doGet
protected void doGet(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response) throws IOException
- Overrides:
doGet
in classorg.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
IOException
-
downloadFile
protected void downloadFile(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response, @Nullable @Nullable String suffix) throws IOException
- Throws:
IOException
-
tailLogfile
protected void tailLogfile(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response, @NotNull @NotNull String[] selectors, @Nullable @Nullable String suffix) throws IOException
- Throws:
IOException
-
getLoggerSession
protected RuntimeFileServlet.LoggerSession getLoggerSession(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable @Nullable String path)
-
treeNode
protected void treeNode(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response, @Nullable @Nullable String suffix) throws IOException
- Throws:
IOException
-
writeFileNode
protected void writeFileNode(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull com.google.gson.stream.JsonWriter writer, @NotNull @NotNull RuntimeFileServlet.RuntimeFile rtFile) throws IOException
- Throws:
IOException
-
writeFileIdentifiers
protected void writeFileIdentifiers(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull com.google.gson.stream.JsonWriter writer, @NotNull @NotNull RuntimeFileServlet.RuntimeFile rtFile) throws IOException
- Throws:
IOException
-
-