Class UploadFileRequest
java.lang.Object
com.iizix.gyro.UploadFileRequest
What a client declares about one file when it asks for an upload reservation: the original name, the declared media type, the uncompressed size, the last-modified time, the proposed compression and an optional group name.
Every value is client-supplied and is metadata only: the service never derives a path from the name, never trusts the type before verification, and treats the size as the declared upper bound that quota and verification hold the transfer to.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe compression proposal,COMPRESSION_NONEorCOMPRESSION_GZIP.static final StringCompression proposal: each chunk is an independent gzip member.static final StringCompression proposal: no compression, the bytes arrive as they are.final StringThe named group the client placed the file in, may be empty.final longThe client's last-modified time in milliseconds since the epoch, 0 if unknown.static final intThe maximum length of an original name that is accepted.final StringThe original file name as the client sent it (metadata only).final longThe declared uncompressed size in bytes.final StringThe declared media type, may be empty.Constructor Summary
ConstructorsConstructorDescriptionUploadFileRequest(String name, String type, long size, long lastModified, String compression, String group) Constructor.Method Summary
Field Details
COMPRESSION_NONE
Compression proposal: no compression, the bytes arrive as they are.- See Also:
COMPRESSION_GZIP
Compression proposal: each chunk is an independent gzip member.- See Also:
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTHThe maximum length of an original name that is accepted.- See Also:
name
The original file name as the client sent it (metadata only).type
The declared media type, may be empty.size
public final long sizeThe declared uncompressed size in bytes.lastModified
public final long lastModifiedThe client's last-modified time in milliseconds since the epoch, 0 if unknown.compression
The compression proposal,COMPRESSION_NONEorCOMPRESSION_GZIP.group
The named group the client placed the file in, may be empty.
Constructor Details
UploadFileRequest
public UploadFileRequest(String name, String type, long size, long lastModified, String compression, String group) Constructor.- Parameters:
name- The original file name, metadata only.type- The declared media type, null for none.size- The declared uncompressed size in bytes.lastModified- The client's last-modified time in milliseconds, 0 if unknown.compression- The compression proposal, null or empty forCOMPRESSION_NONE.group- The group name, null for none.- Throws:
IllegalArgumentException- If the name is empty or over-long, the size is negative, or the compression is not one of the two known values.
Method Details
isGzip
toString