Class OssUploader
java.lang.Object
com.alibaba.dashscope.resources.oss.OssUploader
OSS upload for local multimodal files (design J8, ported from 2.x OSSUtils): two-step flow —
GET /uploads?action=getPolicy&model= fetches a short-lived policy certificate, then a
multipart POST to the returned upload_host stores the file. The resulting reference is
oss://<upload_dir>/<fileName>. Credentials ride on the 3.0 transport (auth interceptor);
failures raise the 3.0 error family.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classServer-issued OSS policy certificate (fields named exactly as on the wire). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncertificate(String model, RequestOptions options) Fetch the policy certificate; public so a caller uploading several files for one request fetches it once and reuses it (2.x parity — validity is governed server-side).upload(String model, Path file, RequestOptions options) Upload one local file, fetching a fresh policy certificate.uploadWithCertificate(OssUploader.Certificate cert, Path file) Multipart POST the file to the certificate's upload host; returns the oss:// reference.
-
Constructor Details
-
OssUploader
-
-
Method Details
-
upload
Upload one local file, fetching a fresh policy certificate. -
certificate
Fetch the policy certificate; public so a caller uploading several files for one request fetches it once and reuses it (2.x parity — validity is governed server-side). -
uploadWithCertificate
Multipart POST the file to the certificate's upload host; returns the oss:// reference.
-