Record Class FileStorage.StagingUploadInfo
java.lang.Object
java.lang.Record
io.leandev.appfuse.file.FileStorage.StagingUploadInfo
- Record Components:
tempId- 暫存檔案 ID(格式:{date}/{uuid})directUploadUrl- backend 直接上傳 URL;application proxy upload 時為 emptyfilename- 原始檔名contentType- MIME 類型size- 檔案大小
- Enclosing interface:
FileStorage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplicationUpload(String tempId, String filename, String contentType, long size) 建立由 application adapter 接收內容的 staging ticket。Returns the value of thecontentTyperecord component.directUpload(String tempId, String uploadUrl, String filename, String contentType, long size) 建立由 backend 提供 URL 的直接上傳 staging ticket。Returns the value of thedirectUploadUrlrecord component.final booleanIndicates whether some other object is "equal to" this one.filename()Returns the value of thefilenamerecord component.final inthashCode()Returns a hash code value for this object.booleanlongsize()Returns the value of thesizerecord component.tempId()Returns the value of thetempIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StagingUploadInfo
public StagingUploadInfo(String tempId, Optional<String> directUploadUrl, String filename, String contentType, long size) Creates an instance of aStagingUploadInforecord class.- Parameters:
tempId- the value for thetempIdrecord componentdirectUploadUrl- the value for thedirectUploadUrlrecord componentfilename- the value for thefilenamerecord componentcontentType- the value for thecontentTyperecord componentsize- the value for thesizerecord component
-
-
Method Details
-
applicationUpload
public static FileStorage.StagingUploadInfo applicationUpload(String tempId, String filename, String contentType, long size) 建立由 application adapter 接收內容的 staging ticket。 -
directUpload
public static FileStorage.StagingUploadInfo directUpload(String tempId, String uploadUrl, String filename, String contentType, long size) 建立由 backend 提供 URL 的直接上傳 staging ticket。 -
isDirectUpload
public boolean isDirectUpload() -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
tempId
-
directUploadUrl
Returns the value of thedirectUploadUrlrecord component.- Returns:
- the value of the
directUploadUrlrecord component
-
filename
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
size
-