Class UploadRequest
java.lang.Object
com.iizix.prop.upload.UploadRequest
One request of a client to upload files: what the client declared - the files with their names, types and sizes, its sequence number, the automatic failure notice switch and the types the requester accepts - and where it came from (design UPLOAD-UI-DESIGN.md edition 2, section 2.2; built by CC-UPLOAD-U1).
An App can hold one and never make one (ruling UD-5): the constructor is package-private, and the only way to an instance is UploadChannelProps.decodeRequest(com.iizix.prop.PropCnr,GProp), which builds it from the parameters of a client's remote event. A reservation therefore only ever answers a request a client made, with the sequence number that client is waiting for.
A request is answered once: by IClientUploadAPI.reserve(UploadRequest,IFileUploadListener) or by IClientUploadAPI.refuse(UploadRequest,String), either of which sends the client ONE RESERVED carrying getSequence(). The API claims the answer through markAnswered(); a second answer is refused there.
Immutable apart from the answered flag, and safe to hand between threads.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptiongetFiles()Gets the files the client declares, in the client's order: the file index of a reservation made from this request is the position in this list.intGets the client's sequence number: the number the client's uploader allocated for this request and correlates theRESERVEDanswer by.GProp<?> Gets the property that asked: the component whose own remote event carried the request.getTypes()Gets the types the requester accepts, in the syntax of the HTMLacceptattribute: comma-separated media types (image/png), families (image/*) and file name extensions (.pdf).booleanChecks if the request has been answered.booleanChecks whether the client wants the automatic failure notice for this request (row 20 of the rulings of 2026-09-24): on by default.booleanClaims the one answer of this request.toString()Outputs to string, without the file names (they are client-supplied and may be hostile to logs).
Method Details
getSequence
public int getSequence()Gets the client's sequence number: the number the client's uploader allocated for this request and correlates theRESERVEDanswer by.- Returns:
- The sequence number, -1 when the client sent none.
getFiles
Gets the files the client declares, in the client's order: the file index of a reservation made from this request is the position in this list.- Returns:
- The files, at least one, unmodifiable.
isNoticeEnabled
public boolean isNoticeEnabled()Checks whether the client wants the automatic failure notice for this request (row 20 of the rulings of 2026-09-24): on by default.- Returns:
- true when failures are to be shown by IIZI, false when the App reports them itself.
getTypes
Gets the types the requester accepts, in the syntax of the HTMLacceptattribute: comma-separated media types (image/png), families (image/*) and file name extensions (.pdf). They narrow the server's$upload.typesfor the reservation made from this request, at reservation and again on the verified type.- Returns:
- The types, empty for any; never null.
getSource
Gets the property that asked: the component whose own remote event carried the request.- Returns:
- The requesting property, or null for a direct
RESERVEon the upload channel.
isAnswered
public boolean isAnswered()Checks if the request has been answered.- Returns:
- true once
markAnswered()has been called.
markAnswered
public boolean markAnswered()Claims the one answer of this request. Called by the upload API of the client session before it reserves or refuses; an App never needs to call it, and one that does can no longer have its request answered.- Returns:
- true for the first caller, false when the request was already answered.
toString