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:
RestrictedService,Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class RuntimeFileServlet extends org.apache.sling.api.servlets.SlingSafeMethodsServlet implements RestrictedService
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRuntimeFileServlet.LogfileFilterstatic classRuntimeFileServlet.LoggerSessionstatic classRuntimeFileServlet.RuntimeFile
-
Field Summary
Fields Modifier and Type Field Description static PatternIS_LOGFILEstatic StringPATH_RESTRICTION_PREFIXprotected ServiceRestrictionsrestrictionsstatic StringRUNTIME_ROOTstatic StringSA_SESSIONSstatic StringSERVICE_KEYstatic StringSERVLET_LABELstatic StringSERVLET_PATH
-
Constructor Summary
Constructors Constructor Description RuntimeFileServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivate()protected voiddoGet(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)protected voiddownloadFile(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @Nullable String suffix)protected @Nullable RuntimeFileServlet.RuntimeFilegetFile(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String suffix)protected RuntimeFileServlet.LoggerSessiongetLoggerSession(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String path)ServiceRestrictions.PermissiongetPermission()ServiceRestrictions.KeygetServiceKey()booleanisEnabled()protected voidtailLogfile(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @NotNull String[] selectors, @Nullable String suffix)protected voidtreeNode(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @Nullable String suffix)protected voidwriteFileIdentifiers(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull com.google.gson.stream.JsonWriter writer, @NotNull RuntimeFileServlet.RuntimeFile rtFile)protected voidwriteFileNode(@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 ServiceRestrictions restrictions
-
-
Method Detail
-
activate
protected void activate()
-
getServiceKey
@NotNull public ServiceRestrictions.Key getServiceKey()
- Specified by:
getServiceKeyin interfaceRestrictedService
-
isEnabled
public final boolean isEnabled()
-
getPermission
public final 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:
doGetin 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
-
-