Class ByteArrayPart

java.lang.Object
org.apache.sling.servlethelpers.ByteArrayPart
All Implemented Interfaces:
jakarta.servlet.http.Part

public class ByteArrayPart extends Object implements jakarta.servlet.http.Part
Simple Part implementation backed by an in-memory byte array
  • Method Details

    • builder

      public static ByteArrayPart.Builder builder()
      Returns a Builder instance used to create a ByteArrayPart
      Returns:
      a new builder instance
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface jakarta.servlet.http.Part
      Throws:
      IOException
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface jakarta.servlet.http.Part
    • getName

      public String getName()
      Specified by:
      getName in interface jakarta.servlet.http.Part
    • getSubmittedFileName

      public String getSubmittedFileName()
      Specified by:
      getSubmittedFileName in interface jakarta.servlet.http.Part
    • getSize

      public long getSize()
      Specified by:
      getSize in interface jakarta.servlet.http.Part
    • write

      public void write(String fileName) throws IOException
      Specified by:
      write in interface jakarta.servlet.http.Part
      Throws:
      IOException
    • delete

      public void delete() throws IOException
      Specified by:
      delete in interface jakarta.servlet.http.Part
      Throws:
      IOException
    • getHeader

      public String getHeader(String name)
      Specified by:
      getHeader in interface jakarta.servlet.http.Part
    • getHeaders

      public Collection<String> getHeaders(String name)
      Specified by:
      getHeaders in interface jakarta.servlet.http.Part
    • getHeaderNames

      public Collection<String> getHeaderNames()
      Specified by:
      getHeaderNames in interface jakarta.servlet.http.Part