Record Class UploadedFilePart
java.lang.Object
java.lang.Record
com.inductiveautomation.perspective.gateway.util.UploadedFilePart
- All Implemented Interfaces:
AutoCloseable
public record UploadedFilePart(String fileId, String contentType, long size, org.apache.commons.io.output.DeferredFileOutputStream deferredContent)
extends Record
implements AutoCloseable
A multipart file part that has been buffered into a
DeferredFileOutputStream. The part's
submitted filename is the client-generated FileId; the owning field id and the
user-facing display name are recovered from the submission JSON via FileSubmissionIndex
when FormFiles.groupByField(java.util.List<com.inductiveautomation.perspective.gateway.util.UploadedFilePart>, java.util.Map<java.lang.String, com.inductiveautomation.perspective.gateway.util.FileSubmissionIndex.FieldFileEntry>) promotes parts to UploadedFiles.-
Constructor Summary
ConstructorsConstructorDescriptionUploadedFilePart(String fileId, String contentType, long size, org.apache.commons.io.output.DeferredFileOutputStream deferredContent) Creates an instance of aUploadedFilePartrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying stream and deletes any temporary file written to disk.Returns the value of thecontentTyperecord component.org.apache.commons.io.output.DeferredFileOutputStreamReturns the value of thedeferredContentrecord component.final booleanIndicates whether some other object is "equal to" this one.fileId()Returns the value of thefileIdrecord component.final inthashCode()Returns a hash code value for this object.longsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UploadedFilePart
public UploadedFilePart(String fileId, String contentType, long size, org.apache.commons.io.output.DeferredFileOutputStream deferredContent) Creates an instance of aUploadedFilePartrecord class.- Parameters:
fileId- the value for thefileIdrecord componentcontentType- the value for thecontentTyperecord componentsize- the value for thesizerecord componentdeferredContent- the value for thedeferredContentrecord component
-
-
Method Details
-
close
public void close()Closes the underlying stream and deletes any temporary file written to disk. Safe to call multiple times.- Specified by:
closein interfaceAutoCloseable
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
fileId
Returns the value of thefileIdrecord component.- Returns:
- the value of the
fileIdrecord component
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
size
public long size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
deferredContent
public org.apache.commons.io.output.DeferredFileOutputStream deferredContent()Returns the value of thedeferredContentrecord component.- Returns:
- the value of the
deferredContentrecord component
-