Package org.apache.sling.servlets.post.impl.operations

# Klasse StreamedUploadOperation

java.lang.Object
org.apache.sling.servlets.post.impl.operations.AbstractPostOperation
org.apache.sling.servlets.post.impl.operations.StreamedUploadOperation

Alle implementierten Schnittstellen:
  `JakartaPostOperation`

public class StreamedUploadOperation extends AbstractPostOperation
Performs a streamed modification of the content. Each File body encountered will result in a session save operation, to cause the underlying Resource implementation to stream content from the request to the target. This implements PostOperation but does not touch the normal Sling Request processing which is not streamed. The map of available fields is built up as the request is streamed. It is advisable to submit the request with all the form fields at the start of the request (normally based on DOM order) to ensure they are available before the streamed bodies are processed. The implementation does not implement the full Sling protocol aiming to keep it simple, and just deal with a streaming upload operation. The implementation binds to the Sling Resource API rather than JCR to keep it independent of the type of persistence.

## Feldübersicht

Felder
Modifizierer und Typ
Feld
Beschreibung
`static final String`
`NT_FILE`

### Von Klasse geerbte Felder org.apache.sling.servlets.post.impl.operations.AbstractPostOperation

`jcrSupport, log`

### Von Schnittstelle geerbte Felder org.apache.sling.servlets.post.JakartaPostOperation

`PROP_OPERATION_NAME, SERVICE_NAME`

## Konstruktorübersicht

Konstruktoren
Konstruktor
Beschreibung
`StreamedUploadOperation()`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`protected void`
`doRun(org.apache.sling.api.SlingJakartaHttpServletRequest request, JakartaPostResponse response, List<Modification> changes)`
Actually performs the desired operation filling progress into the `changes` list and preparing and further information in the `response`.
`boolean`
`isRequestStreamed(org.apache.sling.api.SlingJakartaHttpServletRequest request)`
Check the request and return true if there is a parts iterator attribute present.
`void`
`setServletContext(jakarta.servlet.ServletContext servletContext)`

### Von Klasse geerbte Methoden org.apache.sling.servlets.post.impl.operations.AbstractPostOperation

`externalizePath, getApplyToResources, getResourcePath, getVersioningConfiguration, isSkipCheckin, orderResource, run`

### Von Klasse geerbte Methoden java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Felddetails

### NT_FILE

public static final String NT_FILE

Siehe auch:
  - Konstantenfeldwerte

## Konstruktordetails

### StreamedUploadOperation

public StreamedUploadOperation()

## Methodendetails

### setServletContext

public void setServletContext(jakarta.servlet.ServletContext servletContext)

### isRequestStreamed

public boolean isRequestStreamed(org.apache.sling.api.SlingJakartaHttpServletRequest request)
Check the request and return true if there is a parts iterator attribute present. This attribute will have been put there by the Sling Engine ParameterSupport class. If its not present, the request is not streamed and cant be processed by this class. Check this first before using this class.

Parameter:
  `request` - the request.
Gibt zurück:
  true if the request can be streamed.

### doRun

protected void doRun(org.apache.sling.api.SlingJakartaHttpServletRequest request, JakartaPostResponse response, List<Modification> changes) throws org.apache.sling.api.resource.PersistenceException
Beschreibung aus Klasse kopiert: `AbstractPostOperation`
Actually performs the desired operation filling progress into the `changes` list and preparing and further information in the `response`.

The `response` comes prepared with the path, location and parent location set. Other properties are expected to be set by this implementation.

Angegeben von:
  `doRun` in Klasse `AbstractPostOperation`
Parameter:
  `request` - The `SlingJakartaHttpServletRequest` providing the input, mostly in terms of request parameters, to the operation.
  `response` - The `PostResponse` to fill with response information
  `changes` - A container to add `Modification` instances representing the operations done.
Löst aus:
  `org.apache.sling.api.resource.PersistenceException` - Maybe thrown if any error occurs while accessing the repository.