├── src ├── test │ ├── resources │ │ └── .gitkeep │ └── java │ │ └── com │ │ └── qcloud │ │ └── cos │ │ ├── utils │ │ ├── VersionInfoUtilsTest.java │ │ ├── CollectionUtilsTest.java │ │ ├── DateUtilsTest.java │ │ ├── JacksonTest.java │ │ ├── IOUtilsTest.java │ │ ├── CodecUtilsTest.java │ │ └── Base64Test.java │ │ ├── transfer │ │ ├── PersistableUploadTest.java │ │ ├── PauseResultTest.java │ │ ├── PersistableDownloadTest.java │ │ └── PersistableResumeDownloadTest.java │ │ ├── event │ │ ├── TransferCompletionFilterTest.java │ │ └── ProgressEventTypeTest.java │ │ ├── internal │ │ └── XmlWriterTest.java │ │ ├── ci │ │ └── CISuiteTest.java │ │ ├── endpoint │ │ ├── DefaultEndpointResolverTest.java │ │ └── CIPicRegionEndpointBuilderTest.java │ │ └── TemporyToken.java └── main │ ├── resources │ └── versionInfo.properties │ └── java │ └── com │ └── qcloud │ └── cos │ ├── model │ ├── CiServiceResult.java │ ├── UploadMode.java │ ├── ciModel │ │ ├── ai │ │ │ ├── FaceRect.java │ │ │ ├── FaceIds.java │ │ │ ├── FaceSearchBucketRequest.java │ │ │ ├── GoodsMattingResponse.java │ │ │ ├── OcrPolygon.java │ │ │ ├── ItemPolygon.java │ │ │ ├── PersonExDescriptionInfo.java │ │ │ └── SucFaceRects.java │ │ ├── job │ │ │ ├── PersonTag.java │ │ │ ├── RhythemScore.java │ │ │ ├── PicProcessOperation.java │ │ │ ├── v2 │ │ │ │ ├── CarRecognitionResult.java │ │ │ │ ├── FaceRecognitionResult.java │ │ │ │ ├── PetRecognitionResult.java │ │ │ │ ├── LicenseRecognitionResult.java │ │ │ │ ├── SplitVideoParts.java │ │ │ │ ├── DetectionAudio.java │ │ │ │ ├── SoundHoundResult.java │ │ │ │ ├── SplitVideoInfoResult.java │ │ │ │ ├── FillInput.java │ │ │ │ ├── MediaTemplateResponseV2.java │ │ │ │ ├── GetPlayListRequest.java │ │ │ │ ├── DNADbConfigsRequest.java │ │ │ │ ├── TimeInfo.java │ │ │ │ ├── DnaConfig.java │ │ │ │ ├── ResultInfo.java │ │ │ │ ├── MediaSong.java │ │ │ │ ├── MediaJobResponseV2.java │ │ │ │ ├── BodyRecognitionResult.java │ │ │ │ ├── WordList.java │ │ │ │ └── DNAResult.java │ │ │ ├── FileProcessJobType.java │ │ │ ├── BaseVideoTag.java │ │ │ ├── ExtractDigitalWatermark.java │ │ │ ├── MediaClipConfig.java │ │ │ ├── BatchJobResponse.java │ │ │ ├── PicProcessResponse.java │ │ │ ├── Subtitles.java │ │ │ ├── PitchScore.java │ │ │ ├── OperationTranslation.java │ │ │ ├── SDRtoHDR.java │ │ │ ├── TranslationResponse.java │ │ │ ├── QualityEstimate.java │ │ │ ├── WatermarkInfo.java │ │ │ ├── DetailedResult.java │ │ │ ├── MsSharpen.java │ │ │ ├── QualityEstimateConfig.java │ │ │ ├── VideoTagResult.java │ │ │ ├── FrameEnhance.java │ │ │ ├── VideoTag.java │ │ │ ├── DownloadConfig.java │ │ │ ├── VocalScore.java │ │ │ ├── MediaJobType.java │ │ │ ├── VocalScoreResult.java │ │ │ ├── MediaResult.java │ │ │ ├── FileProcessJobResponse.java │ │ │ ├── AIGCMetadataResponse.java │ │ │ ├── MediaJobResponse.java │ │ │ ├── ErrorDetail.java │ │ │ ├── ObjectTag.java │ │ │ ├── PicProcessRequest.java │ │ │ ├── DocWatermark.java │ │ │ ├── MediaTags.java │ │ │ ├── KeyConfig.java │ │ │ ├── PicProcess.java │ │ │ ├── SentenceScores.java │ │ │ ├── SceneChangeInfo.java │ │ │ ├── TranslationOutput.java │ │ │ ├── BBox.java │ │ │ ├── ImageQualityRequest.java │ │ │ ├── Md5Info.java │ │ │ ├── VqaPlusResult.java │ │ │ ├── ObjectTagInfo.java │ │ │ ├── FileHashCodeConfig.java │ │ │ ├── StreamData.java │ │ │ └── ZipPreviewRequest.java │ │ ├── auditing │ │ │ ├── ValueInfo.java │ │ │ ├── TeenagerInfo.java │ │ │ ├── MeaninglessInfo.java │ │ │ ├── AuditingLabels.java │ │ │ ├── AdsInfo.java │ │ │ ├── PornInfo.java │ │ │ ├── AbuseInfo.java │ │ │ ├── TerroristInfo.java │ │ │ ├── IllegalInfo.java │ │ │ ├── StrategyTextLabel.java │ │ │ ├── CallbackVersion.java │ │ │ ├── StrategyAudioLabel.java │ │ │ ├── StrategyImageLabel.java │ │ │ ├── StorageConf.java │ │ │ ├── SuggestedLabel.java │ │ │ ├── ResultsTextAuditingDetail.java │ │ │ ├── PoliticsInfo.java │ │ │ ├── TextPosition.java │ │ │ ├── SentimentAnalysisDetail.java │ │ │ ├── DetectType.java │ │ │ ├── AuditingAudio.java │ │ │ ├── ListInfo.java │ │ │ ├── LibResult.java │ │ │ ├── AuditingRecordInfo.java │ │ │ ├── ResultsImageAuditingDetail.java │ │ │ ├── MaskInfo.java │ │ │ ├── DocumentAuditingResponse.java │ │ │ ├── SentimentAnalysis.java │ │ │ ├── AuditingStrategyResponse.java │ │ │ ├── AudioAuditingResponse.java │ │ │ ├── VideoAuditingResponse.java │ │ │ ├── AuditingStrategyListResponse.java │ │ │ ├── BatchImageAuditingResponse.java │ │ │ ├── AuditingLiveOutput.java │ │ │ └── AuditingImage.java │ │ ├── metaInsight │ │ │ ├── InputFaceBoundary.java │ │ │ ├── Persons.java │ │ │ ├── DeleteDatasetBindingResponse.java │ │ │ ├── ImageResult.java │ │ │ ├── CreateDatasetResponse.java │ │ │ ├── UpdateFileMetaIndexResponse.java │ │ │ ├── DeleteFileMetaIndexResponse.java │ │ │ ├── DeleteDatasetRequest.java │ │ │ ├── Aggregations.java │ │ │ ├── DeleteDatasetResponse.java │ │ │ ├── UpdateDatasetResponse.java │ │ │ ├── DescribeDatasetResponse.java │ │ │ ├── CreateDatasetBindingResponse.java │ │ │ ├── CreateFileMetaIndexResponse.java │ │ │ ├── DescribeDatasetBindingResponse.java │ │ │ ├── Groups.java │ │ │ ├── SearchImageResponse.java │ │ │ ├── DescribeFileMetaIndexResponse.java │ │ │ ├── DescribeFileMetaIndexRequest.java │ │ │ ├── DescribeDatasetBindingRequest.java │ │ │ ├── DeleteFileMetaIndexRequest.java │ │ │ └── CreateFileMetaIndexRequest.java │ │ ├── image │ │ │ ├── LabelV2.java │ │ │ ├── ImageInspectRequest.java │ │ │ ├── AutoTranslationBlockResponse.java │ │ │ ├── ImageStyleResponse.java │ │ │ ├── StyleRule.java │ │ │ └── OpenImageSearchRequest.java │ │ ├── queue │ │ │ ├── DocQueueResponse.java │ │ │ ├── DocListQueueResponse.java │ │ │ └── MediaQueueResponse.java │ │ ├── bucket │ │ │ ├── DocBucketObject.java │ │ │ ├── DocBucketRequest.java │ │ │ └── MediaBucketResponse.java │ │ ├── workflow │ │ │ ├── AudioInfo.java │ │ │ ├── MediaWorkflowDependency.java │ │ │ ├── FormatInfo.java │ │ │ ├── MediaWorkflowStart.java │ │ │ ├── AttachParam.java │ │ │ └── SpriteObjectInfo.java │ │ ├── xml │ │ │ └── CIAuditingXmlFactoryV2.java │ │ ├── mediaInfo │ │ │ ├── MediaTag.java │ │ │ └── MediaInfoResponse.java │ │ ├── recognition │ │ │ ├── CodeLocation.java │ │ │ └── QRcodeInfo.java │ │ ├── hls │ │ │ ├── CreateHLSPlayKeyRequest.java │ │ │ ├── GetHLSPlayKeyRequest.java │ │ │ ├── CreateHLSPlayKeyResponse.java │ │ │ ├── GetHLSPlayKeyResponse.java │ │ │ ├── UpdataHLSPlayKeyResponse.java │ │ │ └── PlayKeyList.java │ │ ├── persistence │ │ │ ├── RuleItem.java │ │ │ ├── FaceDetailInfos.java │ │ │ ├── PlateDetailInfos.java │ │ │ ├── Rule.java │ │ │ ├── FacePlateMosaicObject.java │ │ │ ├── CarLocation.java │ │ │ └── FailedMessage.java │ │ ├── snapshot │ │ │ ├── PrivateM3U8Response.java │ │ │ └── SnapshotResponse.java │ │ ├── common │ │ │ ├── MediaVod.java │ │ │ └── FileProcessInputObject.java │ │ ├── utils │ │ │ └── CICheckUtils.java │ │ └── template │ │ │ └── MediaHlsEncryptObject.java │ ├── inventory │ │ ├── PostBucketInventoryConfigurationResult.java │ │ ├── InventoryAndPredicate.java │ │ └── InventoryEncryption.java │ ├── CosServiceResult.java │ ├── AppendObjectResult.java │ ├── fetch │ │ └── GetAsyncFetchTaskRequest.java │ ├── IntelligentTiering │ │ ├── IntelligentTieringFilter.java │ │ └── IntelligentTieringTransition.java │ ├── Filter.java │ ├── BucketObjectLockConfiguration.java │ ├── ParquetInput.java │ ├── COSEncryption.java │ ├── DecompressionResult.java │ ├── HeadBucketRequest.java │ ├── PutSymlinkResult.java │ ├── AppendObjectRequest.java │ ├── DeleteBucketReplicationConfigurationRequest.java │ ├── GetBucketReplicationConfigurationRequest.java │ ├── GetBucketLocationRequest.java │ ├── bucketcertificate │ │ └── BucketDomainCertificateParameters.java │ ├── ListBucketsResult.java │ └── GetBucketAclRequest.java │ ├── http │ ├── HandlerAfterProcess.java │ ├── DefaultHandlerAfterProcess.java │ ├── HttpProtocol.java │ └── HttpMethodName.java │ ├── utils │ ├── CollectionUtils.java │ └── Codec.java │ ├── auth │ ├── COSCredentialsFetcher.java │ ├── CredentialsEndpointProvider.java │ ├── InstanceCredentialsRetryPolicy.java │ ├── HttpCredentialsEndpointProvider.java │ ├── CredentialsEndpointRetryPolicy.java │ └── COSSessionCredentials.java │ ├── internal │ ├── cihandler │ │ ├── CICommonHandler.java │ │ ├── CIJsonHandler.java │ │ ├── AuditingTextLibHandler.java │ │ ├── AuditingStrategyHandler.java │ │ ├── HttpEntityEnclosingDelete.java │ │ ├── ReportBadCaseHandler.java │ │ ├── GenerateQrcodeHandler.java │ │ └── AutoTranslationBlockResponseHandler.java │ ├── CosClientAbortTaskMonitor.java │ ├── CosClientAbortTask.java │ ├── DefaultClientAbortTaskImpl.java │ ├── COSDefaultAclHeaderHandler.java │ ├── Unmarshaller.java │ ├── CIPicServiceRequest.java │ ├── CIWorkflowServiceRequest.java │ ├── ReadLimitInfo.java │ └── converter │ │ └── CIConverter.java │ ├── transfer │ ├── CIPostJob.java │ └── DownloadPart.java │ ├── exception │ ├── ServiceExceptionConstants.java │ ├── ExceptionLogDetail.java │ ├── ResponseNotCompleteException.java │ └── ClientExceptionConstants.java │ ├── demo │ └── ci │ │ ├── CIUniversalDemo.java │ │ ├── GetHLSPlayKeyDemo.java │ │ ├── BaseCosImageProcessDemo.java │ │ ├── UpdataHLSPlayKeyDemo.java │ │ ├── CreateHLSPlayKeyDemo.java │ │ └── ImageQualityDemo.java │ └── COSEncryption.java ├── .gitignore ├── .code.yml ├── .travis.yml ├── README.md └── LICENSE /src/test/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | .project 3 | *.iml 4 | target/ -------------------------------------------------------------------------------- /src/main/resources/versionInfo.properties: -------------------------------------------------------------------------------- 1 | version=${project.version} 2 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/CiServiceResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | public class CiServiceResult extends CosServiceResult{ 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/UploadMode.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | public enum UploadMode { 4 | APPEND_OBJECT, 5 | PUT_OBJECT; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/FaceRect.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | public class FaceRect extends SucFaceRects { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/PersonTag.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class PersonTag extends CommonTag{ 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/RhythemScore.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class RhythemScore extends PitchScore { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/ValueInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class ValueInfo extends AudtingCommonInfo { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/InputFaceBoundary.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | public class InputFaceBoundary { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/TeenagerInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class TeenagerInfo extends AudtingCommonInfo { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/http/HandlerAfterProcess.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.http; 2 | 3 | public interface HandlerAfterProcess { 4 | public void handle(int status, long time_cost); 5 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/MeaninglessInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class MeaninglessInfo extends AudtingCommonInfo { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/image/LabelV2.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.image; 2 | 3 | /** 4 | * 标签信息V2 5 | */ 6 | public class LabelV2 extends Label { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/PicProcessOperation.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class PicProcessOperation extends MediaJobOperation { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingLabels.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class AuditingLabels extends BaseAuditingDetail { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/CarRecognitionResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | public class CarRecognitionResult extends BodyRecognitionResult{ 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/FaceRecognitionResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | public class FaceRecognitionResult extends BodyRecognitionResult { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/PetRecognitionResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | public class PetRecognitionResult extends BodyRecognitionResult{ 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AdsInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 广告审核信息实体类 5 | */ 6 | public class AdsInfo extends AudtingCommonInfo { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/LicenseRecognitionResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | public class LicenseRecognitionResult extends BodyRecognitionResult { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/PornInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 鉴黄审核信息实体类 5 | */ 6 | public class PornInfo extends AudtingCommonInfo { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AbuseInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 审核场景为谩骂的审核结果信息 5 | */ 6 | public class AbuseInfo extends AudtingCommonInfo { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/TerroristInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 鉴暴恐审核信息 5 | */ 6 | public class TerroristInfo extends AudtingCommonInfo { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/IllegalInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 审核场景为违法的审核结果信息 5 | */ 6 | public class IllegalInfo extends AudtingCommonInfo { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/FileProcessJobType.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public enum FileProcessJobType { 4 | 5 | FileCompress, FileUncompress, FileHashCode 6 | 7 | } 8 | -------------------------------------------------------------------------------- /.code.yml: -------------------------------------------------------------------------------- 1 | source: 2 | third_party_source: 3 | filepath_regex: [".*/test/.*", ".*/demo/.*", ".*/auth/.*", ".*/crypto/.*", ".*/model/.*", ".*/internal/.*", ".*/event/.*", ".*/transfer/.*", ".*/utils/.*", ".*COS.*"] 4 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/BaseVideoTag.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class BaseVideoTag { 4 | private String tag; 5 | private String tagCls; 6 | private String confidence; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/http/DefaultHandlerAfterProcess.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.http; 2 | 3 | public class DefaultHandlerAfterProcess implements HandlerAfterProcess{ 4 | @Override 5 | public void handle(int status, long time_cost) {} 6 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/queue/DocQueueResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.queue; 2 | 3 | /** 4 | * 文档预览 队列响应实体 https://cloud.tencent.com/document/product/460/46947 5 | */ 6 | public class DocQueueResponse extends MediaQueueResponse { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/StrategyTextLabel.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("Text") 6 | public class StrategyTextLabel extends BaseStrategyLabel { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/CallbackVersion.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 5 | */ 6 | public enum CallbackVersion { 7 | 8 | Simple, Detail 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/StrategyAudioLabel.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("Audio") 6 | public class StrategyAudioLabel extends BaseStrategyLabel { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/StrategyImageLabel.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("Image") 6 | public class StrategyImageLabel extends BaseStrategyLabel{ 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/bucket/DocBucketObject.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.bucket; 2 | 3 | /** 4 | * 数据万象文档预览bucket实体类 字段详情见 https://cloud.tencent.com/document/product/460/46945 5 | */ 6 | public class DocBucketObject extends MediaBucketObject { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/ExtractDigitalWatermark.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | 4 | /** 5 | * 数字水印配置 参数详情见:https://cloud.tencent.com/document/product/460/66008 6 | */ 7 | public class ExtractDigitalWatermark extends MediaDigitalWatermark{ 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/queue/DocListQueueResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.queue; 2 | 3 | /** 4 | * 文档预览 队列列表响应实体 https://cloud.tencent.com/document/product/460/46946 5 | */ 6 | public class DocListQueueResponse extends MediaListQueueResponse { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/bucket/DocBucketRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.bucket; 2 | 3 | /** 4 | * 数据万象 文档预览bucket相关接口请求实体类 对应参数详情:https://cloud.tencent.com/document/product/460/46945 5 | */ 6 | public class DocBucketRequest extends MediaBucketRequest { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/VersionInfoUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import org.junit.Test; 4 | 5 | public class VersionInfoUtilsTest { 6 | @Test 7 | public void testVersionInfoUtils() { 8 | String plat = VersionInfoUtils.getPlatform(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/utils/CollectionUtils.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import java.util.Collection; 4 | 5 | public class CollectionUtils { 6 | 7 | public static boolean isNullOrEmpty(Collection collection) { 8 | return collection == null || collection.isEmpty(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/auth/COSCredentialsFetcher.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.auth; 2 | 3 | import com.qcloud.cos.exception.CosClientException; 4 | 5 | public interface COSCredentialsFetcher { 6 | COSCredentials fetch() throws CosClientException; 7 | 8 | COSCredentials fetch(int retryTimes) throws CosClientException; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/CICommonHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import java.io.InputStream; 4 | 5 | public class CICommonHandler { 6 | 7 | public T getResponse(InputStream in, Class tClass) { 8 | return XStreamXmlResponsesSaxParser.toBean(in, tClass); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/StorageConf.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class StorageConf { 4 | private String path; 5 | 6 | public String getPath() { 7 | return path; 8 | } 9 | 10 | public void setPath(String path) { 11 | this.path = path; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/CollectionUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.ArrayList; 6 | 7 | import static org.junit.Assert.*; 8 | 9 | public class CollectionUtilsTest { 10 | 11 | @Test 12 | public void isNullOrEmpty() { 13 | assertTrue(CollectionUtils.isNullOrEmpty(new ArrayList<>())); 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/DateUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.Date; 6 | 7 | public class DateUtilsTest { 8 | @Test 9 | public void testParseISO8601Date() { 10 | String time_str = "292278994-03-29T10:05:45.001+0000"; 11 | Date date = DateUtils.parseISO8601Date(time_str); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/CosClientAbortTaskMonitor.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal; 2 | 3 | import org.apache.http.client.methods.HttpRequestBase; 4 | 5 | public interface CosClientAbortTaskMonitor { 6 | void setCurrentHttpRequest(HttpRequestBase newRequest); 7 | 8 | boolean hasTimeoutExpired(); 9 | 10 | boolean isEnabled(); 11 | 12 | void cancelTask(); 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/transfer/PersistableUploadTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.transfer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class PersistableUploadTest { 8 | 9 | @Test 10 | public void getPauseType() { 11 | PersistableUpload p = new PersistableUpload(); 12 | assertEquals("upload", p.getPauseType()); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/CosClientAbortTask.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal; 2 | 3 | import org.apache.http.client.methods.HttpRequestBase; 4 | 5 | public interface CosClientAbortTask extends Runnable { 6 | void setCurrentHttpRequest(HttpRequestBase newRequest); 7 | 8 | boolean hasClientExecutionAborted(); 9 | 10 | boolean isEnabled(); 11 | 12 | void cancel(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/transfer/CIPostJob.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.transfer; 2 | 3 | import com.qcloud.cos.exception.PauseException; 4 | 5 | import java.io.IOException; 6 | 7 | public interface CIPostJob extends Transfer { 8 | 9 | /** 10 | * Cancels this download. 11 | * 12 | * @throws IOException 13 | */ 14 | public void abort() throws IOException; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/exception/ServiceExceptionConstants.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.exception; 2 | 3 | public class ServiceExceptionConstants { 4 | 5 | public static final String ERROR_CODE_INTERNAL_ERROR = "InternalError"; 6 | 7 | public static final String ERROR_CODE_SLOWDOWN = "SlowDown"; 8 | 9 | public static final String ERROR_CODE_SERVICE_UNAVAILABLE = "ServiceUnavailable"; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/SuggestedLabel.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 内容审核标签 https://cloud.tencent.com/document/product/460/75497 5 | */ 6 | public enum SuggestedLabel { 7 | 8 | Normal, 9 | Porn, 10 | Terrorism, 11 | Politics, 12 | Ads, 13 | Illegal, 14 | Abuse, 15 | Teenager, 16 | Sexy, 17 | Religion 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/SplitVideoParts.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SplitVideoParts { 6 | @XStreamAlias("Mode") 7 | private String mode; 8 | 9 | public String getMode() { 10 | return mode; 11 | } 12 | 13 | public void setMode(String mode) { 14 | this.mode = mode; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/DetectionAudio.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class DetectionAudio { 6 | 7 | @XStreamAlias("Similar") 8 | private String similar; 9 | 10 | public String getSimilar() { 11 | return similar; 12 | } 13 | 14 | public void setSimilar(String similar) { 15 | this.similar = similar; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/inventory/PostBucketInventoryConfigurationResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.inventory; 2 | 3 | import com.qcloud.cos.model.CosServiceResult; 4 | 5 | public class PostBucketInventoryConfigurationResult extends CosServiceResult { 6 | private String jobId; 7 | 8 | public String getJobId() { 9 | return jobId; 10 | } 11 | 12 | public void setJobId(String jobId) { 13 | this.jobId = jobId; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/CIJsonHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | 8 | public class CIJsonHandler { 9 | 10 | public T getResponse(InputStream in, Class tClass) throws IOException { 11 | ObjectMapper mapper = new ObjectMapper(); 12 | return mapper.readValue(in, tClass); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/transfer/DownloadPart.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.transfer; 2 | 3 | public class DownloadPart { 4 | public final long start; 5 | public final long end; 6 | public final long crc64; 7 | 8 | public DownloadPart(long start, long end, long crc64) { 9 | this.start = start; 10 | this.end = end; 11 | this.crc64 = crc64; 12 | } 13 | 14 | public long getContentLength() { 15 | return end + 1 - start; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/exception/ExceptionLogDetail.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.exception; 2 | 3 | public class ExceptionLogDetail { 4 | public ExceptionLogDetail(Throwable t, String msg) { 5 | this.t = t; 6 | this.errMsg = msg; 7 | } 8 | 9 | public Throwable getException() { 10 | return t; 11 | } 12 | 13 | public String getErrMsg() { 14 | return errMsg; 15 | } 16 | 17 | private Throwable t; 18 | 19 | private String errMsg; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/Persons.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class Persons { 6 | 7 | /** 8 | *自定义人物 ID。 9 | */ 10 | @JsonProperty("PersonId") 11 | private String personId; 12 | 13 | public String getPersonId() { return personId; } 14 | 15 | public void setPersonId(String personId) { this.personId = personId; } 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/workflow/AudioInfo.java: -------------------------------------------------------------------------------- 1 | 2 | package com.qcloud.cos.model.ciModel.workflow; 3 | 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Audio") 7 | public class AudioInfo { 8 | @XStreamAlias("Duration") 9 | private String duration; 10 | 11 | public String getDuration() { 12 | return duration; 13 | } 14 | 15 | public void setDuration(String duration) { 16 | this.duration = duration; 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/xml/CIAuditingXmlFactoryV2.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.xml; 2 | 3 | 4 | import com.qcloud.cos.internal.cihandler.XStreamXmlResponsesSaxParser; 5 | 6 | /** 7 | * 数据万象内容审核xml格式化 8 | */ 9 | public class CIAuditingXmlFactoryV2 extends CIAuditingXmlFactory { 10 | 11 | public static byte[] convertToXmlByteArray(Object obj) { 12 | String s = XStreamXmlResponsesSaxParser.toXML(obj); 13 | return s.getBytes(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/mediaInfo/MediaTag.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.mediaInfo; 2 | 3 | /** 4 | * 媒体处理任务的 Tag 5 | */ 6 | public enum MediaTag { 7 | Transcode, 8 | Snapshot, 9 | Animation, 10 | Concat, 11 | SmartCover, 12 | VideoProcess, 13 | VideoMontage, 14 | VoiceSeparate, 15 | SDRtoHDR, 16 | DigitalWatermark, 17 | ExtractDigitalWatermark, 18 | SuperResolution, 19 | VideoTag, 20 | PicProcess, 21 | Segment 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/transfer/PauseResultTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.transfer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class PauseResultTest { 8 | 9 | @Test 10 | public void PauseResultException() { 11 | assertThrows(IllegalArgumentException.class, () -> new PauseResult<>( null, new Object())); 12 | } 13 | 14 | @Test 15 | public void PauseResult() { 16 | assertNotNull(new PauseResult(PauseStatus.SUCCESS)); 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/AuditingTextLibHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import com.qcloud.cos.model.ciModel.auditing.AuditingTextLibResponse; 4 | 5 | import java.io.InputStream; 6 | 7 | public class AuditingTextLibHandler extends XStreamXmlResponsesSaxParser { 8 | 9 | @Override 10 | public AuditingTextLibResponse getResponse(InputStream in) { 11 | return toBean(in, AuditingTextLibResponse.class); 12 | } 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/MediaClipConfig.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MediaClipConfig { 6 | /** 7 | * 分片时长, 默认5s 8 | */ 9 | @XStreamAlias("Duration") 10 | private String duration; 11 | 12 | public String getDuration() { 13 | return duration; 14 | } 15 | 16 | public void setDuration(String duration) { 17 | this.duration = duration; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/recognition/CodeLocation.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.recognition; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 4 | 5 | import java.util.List; 6 | 7 | public class CodeLocation { 8 | @XStreamImplicit(itemFieldName = "Point") 9 | List points; 10 | 11 | public List getPoints() { 12 | return points; 13 | } 14 | 15 | public void setPoints(List points) { 16 | this.points = points; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/hls/CreateHLSPlayKeyRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.hls; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | @XStreamAlias("Request") 12 | public class CreateHLSPlayKeyRequest extends CIServiceRequest { 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/hls/GetHLSPlayKeyRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.hls; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | @XStreamAlias("Request") 12 | public class GetHLSPlayKeyRequest extends CIServiceRequest { 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/event/TransferCompletionFilterTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.event; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class TransferCompletionFilterTest { 8 | 9 | @Test 10 | public void filter() { 11 | ProgressEventFilter f = new TransferCompletionFilter(); 12 | assertNull(f.filter(new ProgressEvent(ProgressEventType.TRANSFER_COMPLETED_EVENT))); 13 | assertNotNull(f.filter(new ProgressEvent(ProgressEventType.TRANSFER_STARTED_EVENT))); 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/RuleItem.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | public class RuleItem { 4 | private String fileid; 5 | private Rule rule; 6 | 7 | public String getFileid() { 8 | return fileid; 9 | } 10 | 11 | public void setFileid(String fileid) { 12 | this.fileid = fileid; 13 | } 14 | 15 | public Rule getRule() { 16 | return rule; 17 | } 18 | 19 | public void setRule(Rule rule) { 20 | this.rule = rule; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/FaceIds.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 4 | 5 | import java.util.List; 6 | 7 | public class FaceIds { 8 | /** 9 | *待删除的人脸ID;是否必传:是 10 | */ 11 | @XStreamImplicit(itemFieldName = "FaceId") 12 | private List faceId; 13 | 14 | public List getFaceId() { 15 | return faceId; 16 | } 17 | 18 | public void setFaceId(List faceId) { 19 | this.faceId = faceId; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/SoundHoundResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 4 | 5 | import java.util.List; 6 | 7 | public class SoundHoundResult { 8 | @XStreamImplicit(itemFieldName = "SongList") 9 | private List songList; 10 | 11 | public List getSongList() { 12 | return songList; 13 | } 14 | 15 | public void setSongList(List songList) { 16 | this.songList = songList; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/SplitVideoInfoResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 4 | 5 | import java.util.List; 6 | 7 | public class SplitVideoInfoResult { 8 | @XStreamImplicit(itemFieldName = "TimeInfo") 9 | List timeInfos; 10 | 11 | public List getTimeInfos() { 12 | return timeInfos; 13 | } 14 | 15 | public void setTimeInfos(List timeInfos) { 16 | this.timeInfos = timeInfos; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/FaceSearchBucketRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | 7 | @XStreamAlias("Request") 8 | public class FaceSearchBucketRequest extends CIServiceRequest { 9 | 10 | @XStreamAlias("GroupName") 11 | private String groupName; 12 | 13 | public String getGroupName() { return groupName; } 14 | 15 | public void setGroupName(String groupName) { this.groupName = groupName; } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/BatchJobResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | public class BatchJobResponse extends CiServiceResult { 6 | private BatchJobDetail jobDetail; 7 | 8 | public BatchJobDetail getJobDetail() { 9 | if (jobDetail == null) { 10 | jobDetail = new BatchJobDetail(); 11 | } 12 | return jobDetail; 13 | } 14 | 15 | public void setJobDetail(BatchJobDetail jobDetail) { 16 | this.jobDetail = jobDetail; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | notifications: 7 | email: 8 | recipients: 9 | - chengwu@tencent.com 10 | - iainyu@tencent.com 11 | - yongqingliu@tencent.com 12 | - wjielai@tencent.com 13 | - fysntian@tencent.com 14 | on_success: always # default: change 15 | on_failure: always # default: always 16 | 17 | install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip=true 18 | 19 | dist: trusty 20 | 21 | script: mvn test -Dtest=com.qcloud.cos.SuiteTest 22 | 23 | cache: 24 | directories: 25 | - $HOME/.m2 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/exception/ResponseNotCompleteException.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.exception; 2 | 3 | public class ResponseNotCompleteException extends CosClientException { 4 | 5 | /** 6 | * Creates a new ResponseNotCompleteException with the specified message, and root 7 | * cause. 8 | * 9 | * @param message An error message describing why this exception was thrown. 10 | * @param t The underlying cause of this exception. 11 | */ 12 | public ResponseNotCompleteException(String message, Throwable t) { 13 | super(message, t); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/CosServiceResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | public class CosServiceResult { 4 | private String requestId; 5 | 6 | /** 7 | * get requestid for this upload 8 | * 9 | * @return requestid 10 | */ 11 | public String getRequestId() { 12 | return requestId; 13 | } 14 | 15 | /** 16 | * set requestId for this upload 17 | * 18 | * @param requestId the requestId for the upload 19 | */ 20 | 21 | public void setRequestId(String requestId) { 22 | this.requestId = requestId; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/GoodsMattingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.qcloud.cos.model.CosServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | import java.io.InputStream; 7 | 8 | 9 | @XStreamAlias("Response") 10 | public class GoodsMattingResponse extends CosServiceResult { 11 | private InputStream content; 12 | 13 | public InputStream getContent() { 14 | return content; 15 | } 16 | 17 | public void setContent(InputStream content) { 18 | this.content = content; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/ResultsTextAuditingDetail.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | 4 | public class ResultsTextAuditingDetail extends BaseAuditingDetail { 5 | private String text; 6 | 7 | public String getText() { 8 | return text; 9 | } 10 | 11 | public void setText(String text) { 12 | this.text = text; 13 | } 14 | 15 | @Override 16 | public String toString() { 17 | final StringBuffer sb = new StringBuffer("ResultsTextAuditingDetail{"); 18 | sb.append('}'); 19 | return sb.toString(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/internal/XmlWriterTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class XmlWriterTest { 8 | 9 | @Test 10 | public void getByte() { 11 | XmlWriter w = new XmlWriter(); 12 | w.start("name", "key", "\t\n\r&\"><"); 13 | w.end(); 14 | assertNotNull(w.getBytes()); 15 | } 16 | 17 | @Test 18 | public void getnull() { 19 | XmlWriter w = new XmlWriter(); 20 | w.start("name", "key", null); 21 | w.end(); 22 | assertNotNull(w.getBytes()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/OcrPolygon.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class OcrPolygon { 6 | @XStreamAlias("X") 7 | private Integer x; // 横坐标 8 | 9 | @XStreamAlias("Y") 10 | private Integer y; // 纵坐标 11 | 12 | public Integer getX() { 13 | return x; 14 | } 15 | 16 | public void setX(Integer x) { 17 | this.x = x; 18 | } 19 | 20 | public Integer getY() { 21 | return y; 22 | } 23 | 24 | public void setY(Integer y) { 25 | this.y = y; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/PoliticsInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | /** 4 | * 鉴政治敏感审核信息 5 | */ 6 | public class PoliticsInfo extends AudtingCommonInfo { 7 | private PoliticsInfoObjectResults politicsInfoObjectResults = new PoliticsInfoObjectResults(); 8 | 9 | public PoliticsInfoObjectResults getPoliticsInfoObjectResults() { 10 | return politicsInfoObjectResults; 11 | } 12 | 13 | public void setPoliticsInfoObjectResults(PoliticsInfoObjectResults politicsInfoObjectResults) { 14 | this.politicsInfoObjectResults = politicsInfoObjectResults; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/FaceDetailInfos.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | import com.qcloud.cos.model.ciModel.ai.FaceRect; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class FaceDetailInfos { 9 | @XStreamImplicit(itemFieldName = "FaceRect") 10 | List faceRectList; 11 | 12 | public List getFaceRectList() { 13 | return faceRectList; 14 | } 15 | 16 | public void setFaceRectList(List faceRectList) { 17 | this.faceRectList = faceRectList; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/PlateDetailInfos.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 4 | 5 | import java.util.List; 6 | 7 | public class PlateDetailInfos { 8 | @XStreamImplicit(itemFieldName = "PlateLocation") 9 | private List plateDetailInfos; 10 | 11 | public List getPlateDetailInfos() { 12 | return plateDetailInfos; 13 | } 14 | 15 | public void setPlateDetailInfos(List plateDetailInfos) { 16 | this.plateDetailInfos = plateDetailInfos; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/exception/ClientExceptionConstants.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.exception; 2 | 3 | public class ClientExceptionConstants { 4 | 5 | public static final String UNKNOWN = "Unknown"; 6 | public static final String CONNECTION_TIMEOUT = "ConnectionTimeout"; 7 | public static final String HOST_CONNECT = "HostConnect"; 8 | public static final String UNKNOWN_HOST = "UnknownHost"; 9 | public static final String SOCKET_TIMEOUT = "SocketTimeout"; 10 | public static final String CLIENT_PROTOCAL_EXCEPTION = "ClientProtocolException"; 11 | public static final String REQUEST_TIMEOUT = "RequestTimeout"; 12 | } 13 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/transfer/PersistableDownloadTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.transfer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class PersistableDownloadTest { 8 | 9 | @Test 10 | public void getRange() { 11 | PersistableDownload p = new PersistableDownload(null, null, null, new long[2], null, null); 12 | assertNotNull(p.getRange()); 13 | } 14 | 15 | @Test 16 | public void getPauseType() { 17 | PersistableDownload p = new PersistableDownload(); 18 | assertNotNull(p); 19 | assertEquals(p.getPauseType(), "download"); 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/auth/CredentialsEndpointProvider.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.auth; 2 | 3 | import java.io.IOException; 4 | import java.net.URI; 5 | import java.net.URISyntaxException; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | public abstract class CredentialsEndpointProvider { 10 | public abstract URI getCredentialsEndpoint() throws URISyntaxException, IOException; 11 | 12 | public CredentialsEndpointRetryPolicy getRetryPolicy() { 13 | return CredentialsEndpointRetryPolicy.NO_RETRY_POLICY; 14 | } 15 | 16 | public Map getHeaders() { 17 | return new HashMap<>(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/AppendObjectResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | public class AppendObjectResult { 4 | private ObjectMetadata metadata; 5 | private Long nextAppendPosition; 6 | 7 | public ObjectMetadata getMetadata() { 8 | return metadata; 9 | } 10 | 11 | public void setMetadata(ObjectMetadata metadata) { 12 | this.metadata = metadata; 13 | } 14 | 15 | public Long getNextAppendPosition() { 16 | return nextAppendPosition; 17 | } 18 | 19 | public void setNextAppendPosition(Long nextAppendPosition) { 20 | this.nextAppendPosition = nextAppendPosition; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/PicProcessResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | 6 | public class PicProcessResponse extends CiServiceResult { 7 | private MediaJobObject jobsDetail; 8 | 9 | public MediaJobObject getJobsDetail() { 10 | if (jobsDetail==null){ 11 | jobsDetail = new MediaJobObject(); 12 | } 13 | return jobsDetail; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "MediaJobResponse{" + 19 | "jobsDetail=" + jobsDetail + 20 | '}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/workflow/MediaWorkflowDependency.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.workflow; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MediaWorkflowDependency { 6 | @XStreamAlias("value") 7 | private String value; 8 | 9 | public String getValue() { 10 | return value; 11 | } 12 | 13 | public void setValue(String value) { 14 | this.value = value; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "MediaWorkflowDependency{" + 20 | "value='" + value + '\'' + 21 | '}'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/Subtitles.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class Subtitles { 9 | @XStreamImplicit(itemFieldName = "Subtitle") 10 | private List subtitle; 11 | 12 | public List getSubtitle() { 13 | if (subtitle == null) { 14 | subtitle = new ArrayList<>(); 15 | } 16 | return subtitle; 17 | } 18 | 19 | public void setSubtitle(List subtitle) { 20 | this.subtitle = subtitle; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/JacksonTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import java.io.StringWriter; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.*; 7 | 8 | public class JacksonTest { 9 | 10 | 11 | @Test 12 | public void jsonNodeOf() { 13 | assertNotNull(Jackson.jsonNodeOf(" \"err\":\n" + 14 | " {\n" + 15 | " \"msg\": \"\",\n" + 16 | " \"rt\": 0\n" + 17 | " }")); 18 | } 19 | 20 | @Test 21 | public void jsonGeneratorOf() throws Exception{ 22 | assertNotNull(Jackson.jsonGeneratorOf(new StringWriter())); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/Rule.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class Rule { 6 | @JsonProperty("ci-process") 7 | private String ciProcess; 8 | private String cover; 9 | 10 | public String getCiProcess() { 11 | return ciProcess; 12 | } 13 | 14 | public void setCiProcess(String ciProcess) { 15 | this.ciProcess = ciProcess; 16 | } 17 | 18 | public String getCover() { 19 | return cover; 20 | } 21 | 22 | public void setCover(String cover) { 23 | this.cover = cover; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/TextPosition.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class TextPosition { 6 | @XStreamAlias("Start") 7 | private Integer start; 8 | @XStreamAlias("End") 9 | private Integer end; 10 | 11 | public Integer getStart() { 12 | return start; 13 | } 14 | 15 | public void setStart(Integer start) { 16 | this.start = start; 17 | } 18 | 19 | public Integer getEnd() { 20 | return end; 21 | } 22 | 23 | public void setEnd(Integer end) { 24 | this.end = end; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/ci/CISuiteTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.ci; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Suite; 5 | import org.junit.runners.Suite.SuiteClasses; 6 | 7 | @RunWith(Suite.class) 8 | @SuiteClasses({ContentAudutingTest.class,DocProcessTest.class,FileProcessTest.class,ImageProcessTest.class,MediaTemplateTest.class 9 | ,MediaJobTest.class,MediaWorkflowTest.class, AuditingKeywordTest.class, AuditingStrategyTest.class, AuditingTextLibTest.class, 10 | HlsTest.class, ImageSearchDemoTest.class, LiveAuditingTest.class, MediaDnaDbsTest.class, PersonFaceTest.class, SpeechRecognitionTest.class}) 11 | public class CISuiteTest { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/FillInput.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class FillInput { 6 | @XStreamAlias("Url") 7 | private String url; 8 | @XStreamAlias("FillTime") 9 | private String fillTime; 10 | 11 | public String getUrl() { 12 | return url; 13 | } 14 | 15 | public void setUrl(String url) { 16 | this.url = url; 17 | } 18 | 19 | public String getFillTime() { 20 | return fillTime; 21 | } 22 | 23 | public void setFillTime(String fillTime) { 24 | this.fillTime = fillTime; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DeleteDatasetBindingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class DeleteDatasetBindingResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | public String getRequestId() { return requestId; } 18 | 19 | public void setRequestId(String requestId) { this.requestId = requestId; } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/snapshot/PrivateM3U8Response.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.snapshot; 2 | 3 | import com.qcloud.cos.model.CosServiceResult; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 媒体截图请求实体 详情见:https://cloud.tencent.com/document/product/460/38934 9 | */ 10 | public class PrivateM3U8Response extends CosServiceResult implements Serializable { 11 | 12 | /** 13 | * 私有 ts 资源 url 下载凭证的相对有效期,单位为秒,范围为[3600, 43200] 14 | */ 15 | private String m3u8; 16 | 17 | public String getM3u8() { 18 | return m3u8; 19 | } 20 | 21 | public void setM3u8(String m3u8) { 22 | this.m3u8 = m3u8; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/workflow/FormatInfo.java: -------------------------------------------------------------------------------- 1 | 2 | package com.qcloud.cos.model.ciModel.workflow; 3 | 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Format") 7 | public class FormatInfo { 8 | @XStreamAlias("Duration") 9 | private String duration; 10 | 11 | public String getDuration() { 12 | return duration; 13 | } 14 | 15 | public void setDuration(String duration) { 16 | this.duration = duration; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return "FormatInfo{" + 22 | "duration='" + duration + '\'' + 23 | '}'; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/fetch/GetAsyncFetchTaskRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.fetch; 2 | 3 | import com.qcloud.cos.internal.CosServiceRequest; 4 | 5 | public class GetAsyncFetchTaskRequest extends CosServiceRequest { 6 | private String bucketName; 7 | private String taskId; 8 | 9 | public void setBucketName(String bucketName) { 10 | this.bucketName = bucketName; 11 | } 12 | 13 | public String getBucketName() { 14 | return this.bucketName; 15 | } 16 | 17 | public void setTaskId(String taskId) { 18 | this.taskId = taskId; 19 | } 20 | 21 | public String getTaskId() { 22 | return this.taskId; 23 | } 24 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cos-java-sdk-v5 ![Build Status](https://api.travis-ci.org/tencentyun/cos-java-sdk-v5.svg?branch=master) 2 | 3 | 4 | 5 | ## maven坐标 6 | 7 | ```xml 8 | 9 | com.qcloud 10 | cos_api 11 | 5.6.227 12 | 13 | ``` 14 | 15 | cos-java-sdk-v5 适用于COS XML API https://www.qcloud.com/document/product/436/7751, 16 | 17 | JSON API 请参照 https://github.com/tencentyun/cos-java-sdk-v4 18 | 19 | 示例程序 demo 请参照 https://github.com/tencentyun/cos-java-sdk-v5/blob/master/src/main/java/com/qcloud/cos/demo 20 | 下的示例代码 21 | 22 | ## 常见问题: 23 | 请参考[FAQ](https://cloud.tencent.com/document/product/436/12263#faq) 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/PitchScore.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | @XStreamAlias("PitchScore") 9 | public class PitchScore { 10 | @XStreamImplicit(itemFieldName = "SentenceScores") 11 | List sentenceScores; 12 | 13 | public List getSentenceScores() { 14 | return sentenceScores; 15 | } 16 | 17 | public void setSentenceScores(List sentenceScores) { 18 | this.sentenceScores = sentenceScores; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/common/MediaVod.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.common; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MediaVod { 6 | @XStreamAlias("FileId") 7 | private String fileId; 8 | @XStreamAlias("SubAppId") 9 | private String subAppId; 10 | 11 | public String getFileId() { 12 | return fileId; 13 | } 14 | 15 | public void setFileId(String fileId) { 16 | this.fileId = fileId; 17 | } 18 | 19 | public String getSubAppId() { 20 | return subAppId; 21 | } 22 | 23 | public void setSubAppId(String subAppId) { 24 | this.subAppId = subAppId; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/OperationTranslation.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("Translation") 6 | public class OperationTranslation { 7 | @XStreamAlias("Lang") 8 | private String lang; 9 | 10 | @XStreamAlias("Type") 11 | private String type; 12 | 13 | public String getLang() { 14 | return lang; 15 | } 16 | 17 | public void setLang(String lang) { 18 | this.lang = lang; 19 | } 20 | 21 | public String getType() { 22 | return type; 23 | } 24 | 25 | public void setType(String type) { 26 | this.type = type; 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/MediaTemplateResponseV2.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.qcloud.cos.model.ciModel.template.MediaTemplateObject; 5 | import com.thoughtworks.xstream.annotations.XStreamAlias; 6 | 7 | @XStreamAlias("Response") 8 | public class MediaTemplateResponseV2 extends CiServiceResult { 9 | 10 | @XStreamAlias("Template") 11 | private MediaTemplateObject template; 12 | 13 | public MediaTemplateObject getTemplate() { 14 | return template; 15 | } 16 | 17 | public void setTemplate(MediaTemplateObject template) { 18 | this.template = template; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/SDRtoHDR.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SDRtoHDR { 6 | @XStreamAlias("HdrMode") 7 | private String hdrMode; 8 | 9 | public String getHdrMode() { 10 | return hdrMode; 11 | } 12 | 13 | public void setHdrMode(String hdrMode) { 14 | this.hdrMode = hdrMode; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | final StringBuffer sb = new StringBuffer("SDRtoHDR{"); 20 | sb.append("hdrMode='").append(hdrMode).append('\''); 21 | sb.append('}'); 22 | return sb.toString(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/ImageResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | public class ImageResult { 5 | 6 | /** 7 | *资源标识字段,表示需要建立索引的文件地址。 8 | */ 9 | @JsonProperty("URI") 10 | private String uRI; 11 | 12 | /** 13 | *相关图片匹配得分。 14 | */ 15 | @JsonProperty("Score") 16 | private Integer score; 17 | 18 | public String getURI() { return uRI; } 19 | 20 | public void setURI(String uRI) { this.uRI = uRI; } 21 | 22 | public Integer getScore() { return score; } 23 | 24 | public void setScore(Integer score) { this.score = score; } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/endpoint/DefaultEndpointResolverTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.endpoint; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | public class DefaultEndpointResolverTest { 8 | @Test 9 | public void test() { 10 | DefaultEndpointResolver resolver = new DefaultEndpointResolver(); 11 | String generapiEndpoint = "xxx-123.cos.ap-beijing-1.myqcloud.com"; 12 | String getServiceApiEndpoint = "service.cos.myqcloud.com"; 13 | assertEquals(generapiEndpoint, resolver.resolveGeneralApiEndpoint(generapiEndpoint)); 14 | assertEquals(getServiceApiEndpoint, resolver.resolveGetServiceApiEndpoint(getServiceApiEndpoint)); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/ItemPolygon.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class ItemPolygon extends OcrPolygon{ 6 | 7 | @XStreamAlias("Width") 8 | private Integer width; // 宽 9 | 10 | @XStreamAlias("Height") 11 | private Integer height; // 高 12 | 13 | public Integer getWidth() { 14 | return width; 15 | } 16 | 17 | public void setWidth(Integer width) { 18 | this.width = width; 19 | } 20 | 21 | public Integer getHeight() { 22 | return height; 23 | } 24 | 25 | public void setHeight(Integer height) { 26 | this.height = height; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/TranslationResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Response") 7 | public class TranslationResponse extends CiServiceResult { 8 | 9 | @XStreamAlias("JobsDetail") 10 | private JobsDetail jobsDetail; 11 | 12 | public String getJobId() { 13 | return jobsDetail != null ? jobsDetail.getJobId() : null; 14 | } 15 | 16 | public JobsDetail getJobsDetail() { 17 | return jobsDetail; 18 | } 19 | 20 | public void setJobsDetail(JobsDetail jobsDetail) { 21 | this.jobsDetail = jobsDetail; 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/CreateDatasetResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | 6 | public class CreateDatasetResponse extends CiServiceResult { 7 | 8 | /** 9 | *请求ID 10 | */ 11 | private String requestId; 12 | 13 | /** 14 | *数据集信息 15 | */ 16 | private Dataset dataset; 17 | 18 | public String getRequestId() { return requestId; } 19 | 20 | public void setRequestId(String requestId) { this.requestId = requestId; } 21 | 22 | public Dataset getDataset() { return dataset; } 23 | 24 | public void setDataset(Dataset dataset) { this.dataset = dataset; } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/QualityEstimate.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class QualityEstimate { 4 | private VqaPlusResult vqaPlusResult; 5 | private String score; 6 | 7 | public VqaPlusResult getVqaPlusResult() { 8 | if (vqaPlusResult == null) { 9 | vqaPlusResult = new VqaPlusResult(); 10 | } 11 | return vqaPlusResult; 12 | } 13 | 14 | public void setVqaPlusResult(VqaPlusResult vqaPlusResult) { 15 | this.vqaPlusResult = vqaPlusResult; 16 | } 17 | 18 | public String getScore() { 19 | return score; 20 | } 21 | 22 | public void setScore(String score) { 23 | this.score = score; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/WatermarkInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class WatermarkInfo { 4 | private String etag; 5 | private String size; 6 | private String page; 7 | 8 | 9 | public String getEtag() { 10 | return etag; 11 | } 12 | 13 | public void setEtag(String etag) { 14 | this.etag = etag; 15 | } 16 | 17 | public String getSize() { 18 | return size; 19 | } 20 | 21 | public void setSize(String size) { 22 | this.size = size; 23 | } 24 | 25 | public String getPage() { 26 | return page; 27 | } 28 | 29 | public void setPage(String page) { 30 | this.page = page; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/UpdateFileMetaIndexResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | public class UpdateFileMetaIndexResponse extends CiServiceResult { 6 | 7 | /** 8 | *请求ID 9 | */ 10 | private String requestId; 11 | 12 | /** 13 | *创建元数据索引的任务ID 14 | */ 15 | private String eventId; 16 | 17 | public String getRequestId() { return requestId; } 18 | 19 | public void setRequestId(String requestId) { this.requestId = requestId; } 20 | 21 | public String getEventId() { return eventId; } 22 | 23 | public void setEventId(String eventId) { this.eventId = eventId; } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/TemporyToken.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos; 2 | 3 | class TemporyToken { 4 | private String tempSecretId; 5 | private String tempSecretKey; 6 | private String tempToken; 7 | 8 | public TemporyToken(String tempSecretId, String tempSecretKey, String tempToken) { 9 | super(); 10 | this.tempSecretId = tempSecretId; 11 | this.tempSecretKey = tempSecretKey; 12 | this.tempToken = tempToken; 13 | } 14 | 15 | public String getTempSecretId() { 16 | return tempSecretId; 17 | } 18 | 19 | public String getTempSecretKey() { 20 | return tempSecretKey; 21 | } 22 | 23 | public String getTempToken() { 24 | return tempToken; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/GetPlayListRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | 5 | public class GetPlayListRequest extends CIServiceRequest { 6 | private String object; 7 | /** 8 | * 私有 ts 资源 url 下载凭证的相对有效期,单位为秒 [3600,43200] 9 | */ 10 | private String expires; 11 | 12 | public String getObject() { 13 | return object; 14 | } 15 | 16 | public void setObject(String object) { 17 | this.object = object; 18 | } 19 | 20 | public String getExpires() { 21 | return expires; 22 | } 23 | 24 | public void setExpires(String expires) { 25 | this.expires = expires; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/IOUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import java.io.ByteArrayInputStream; 6 | import java.io.InputStream; 7 | import java.io.ByteArrayOutputStream; 8 | 9 | import static org.junit.Assert.assertEquals; 10 | 11 | public class IOUtilsTest { 12 | @Test 13 | public void testIOUtils() throws Exception{ 14 | int inputStreamLength = 100; 15 | byte data[] = new byte[inputStreamLength]; 16 | InputStream inputStream = new ByteArrayInputStream(data); 17 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 18 | long count = IOUtils.copy(inputStream, baos); 19 | assertEquals(inputStreamLength, count); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/AuditingStrategyHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import com.qcloud.cos.model.ciModel.auditing.AuditingStrategyListResponse; 4 | import com.qcloud.cos.model.ciModel.auditing.AuditingStrategyResponse; 5 | 6 | import java.io.InputStream; 7 | 8 | public class AuditingStrategyHandler extends XStreamXmlResponsesSaxParser { 9 | 10 | @Override 11 | public AuditingStrategyResponse getResponse(InputStream in) { 12 | return toBean(in, AuditingStrategyResponse.class); 13 | } 14 | 15 | public AuditingStrategyListResponse getResponseList(InputStream in) { 16 | return toBean(in, AuditingStrategyListResponse.class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/HttpEntityEnclosingDelete.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; 4 | 5 | import java.net.URI; 6 | 7 | public class HttpEntityEnclosingDelete extends HttpEntityEnclosingRequestBase { 8 | public static final String METHOD_NAME = "DELETE"; 9 | 10 | public HttpEntityEnclosingDelete() { 11 | 12 | } 13 | public HttpEntityEnclosingDelete(URI uri) { 14 | this.setURI(uri); 15 | } 16 | 17 | public HttpEntityEnclosingDelete(String uri) { 18 | this.setURI(URI.create(uri)); 19 | } 20 | 21 | @Override 22 | public String getMethod() { 23 | return METHOD_NAME; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/DetailedResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class DetailedResult { 7 | private String type; 8 | private List items; 9 | 10 | public String getType() { 11 | return type; 12 | } 13 | 14 | public void setType(String type) { 15 | this.type = type; 16 | } 17 | 18 | public List getItems() { 19 | if (items == null) { 20 | items = new ArrayList<>(); 21 | } 22 | return items; 23 | } 24 | 25 | public void setItems(List items) { 26 | this.items = items; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/demo/ci/CIUniversalDemo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.demo.ci; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import com.qcloud.cos.model.ciModel.common.AICommonRequest; 5 | 6 | public class CIUniversalDemo { 7 | public static void main(String[] args) throws InterruptedException { 8 | // 1 初始化用户身份信息(secretId, secretKey)。 9 | COSClient client = ClientUtils.getTestClient(); 10 | // 2 调用要使用的方法。 11 | customCIMethod(client); 12 | } 13 | 14 | public static void customCIMethod(COSClient client) { 15 | //1.创建任务请求对象 16 | AICommonRequest request = new AICommonRequest(); 17 | request.setBucketName("demo-1234567890"); 18 | request.setObjectKey("ObjectKey"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/SentimentAnalysisDetail.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SentimentAnalysisDetail { 6 | @XStreamAlias("Negative") 7 | private Integer negative; 8 | 9 | @XStreamAlias("Positive") 10 | private Integer positive; 11 | 12 | public Integer getNegative() { 13 | return negative; 14 | } 15 | 16 | public void setNegative(Integer negative) { 17 | this.negative = negative; 18 | } 19 | 20 | public Integer getPositive() { 21 | return positive; 22 | } 23 | 24 | public void setPositive(Integer positive) { 25 | this.positive = positive; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/MsSharpen.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MsSharpen { 6 | @XStreamAlias("SharpenLevel") 7 | private String sharpenLevel; 8 | 9 | public String getSharpenLevel() { 10 | return sharpenLevel; 11 | } 12 | 13 | public void setSharpenLevel(String sharpenLevel) { 14 | this.sharpenLevel = sharpenLevel; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | final StringBuffer sb = new StringBuffer("MsSharpen{"); 20 | sb.append("sharpenLevel='").append(sharpenLevel).append('\''); 21 | sb.append('}'); 22 | return sb.toString(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/IntelligentTiering/IntelligentTieringFilter.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.IntelligentTiering; 2 | 3 | import com.qcloud.cos.model.TagSet; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | public class IntelligentTieringFilter implements Serializable { 9 | private String prefix; 10 | 11 | private List tagSets; 12 | 13 | public void setPrefix(String prefix) { 14 | this.prefix = prefix; 15 | } 16 | 17 | public String getPrefix() { 18 | return prefix; 19 | } 20 | 21 | public List getAllTagSets() { 22 | return this.tagSets; 23 | } 24 | 25 | public void setTagSets(List tagSets) { 26 | this.tagSets = tagSets; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/QualityEstimateConfig.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class QualityEstimateConfig { 4 | /** 5 | * 旋转角度, 只支持 0 90 180 270 6 | */ 7 | private String rotate; 8 | /** 9 | * 分析模式 10 | * general: 普通分析, 只返回视频质量分数 11 | * vqaPlus: 返回更详细的分析结果 12 | * 设置为vqaPlus时,Rotate 参数无效 13 | */ 14 | private String mode; 15 | 16 | public String getRotate() { 17 | return rotate; 18 | } 19 | 20 | public void setRotate(String rotate) { 21 | this.rotate = rotate; 22 | } 23 | 24 | public String getMode() { 25 | return mode; 26 | } 27 | 28 | public void setMode(String mode) { 29 | this.mode = mode; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DeleteFileMetaIndexResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.qcloud.cos.model.CiServiceResult; 5 | import com.thoughtworks.xstream.annotations.XStreamAlias; 6 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 7 | 8 | import java.util.List; 9 | 10 | 11 | public class DeleteFileMetaIndexResponse extends CiServiceResult { 12 | 13 | /** 14 | *请求ID 15 | */ 16 | @JsonProperty("RequestId") 17 | private String requestId; 18 | 19 | public String getRequestId() { return requestId; } 20 | 21 | public void setRequestId(String requestId) { this.requestId = requestId; } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/recognition/QRcodeInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.recognition; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class QRcodeInfo { 6 | @XStreamAlias("codeUrl") 7 | private String codeUrl; 8 | @XStreamAlias("CodeLocation") 9 | private CodeLocation codeLocation; 10 | 11 | public String getCodeUrl() { 12 | return codeUrl; 13 | } 14 | 15 | public void setCodeUrl(String codeUrl) { 16 | this.codeUrl = codeUrl; 17 | } 18 | 19 | public CodeLocation getCodeLocation() { 20 | return codeLocation; 21 | } 22 | 23 | public void setCodeLocation(CodeLocation codeLocation) { 24 | this.codeLocation = codeLocation; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/VideoTagResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class VideoTagResult { 6 | @XStreamAlias("StreamData") 7 | private StreamData streamData; 8 | 9 | public StreamData getStreamData() { 10 | if (streamData == null) { 11 | streamData = new StreamData(); 12 | } 13 | return streamData; 14 | } 15 | 16 | public void setStreamData(StreamData streamData) { 17 | this.streamData = streamData; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return "VideoTagResult{" + 23 | "streamData=" + streamData + 24 | '}'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/auth/InstanceCredentialsRetryPolicy.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.auth; 2 | 3 | public class InstanceCredentialsRetryPolicy implements CredentialsEndpointRetryPolicy { 4 | private static final int MAX_RETRIES = 5; 5 | 6 | private static InstanceCredentialsRetryPolicy instance; 7 | 8 | public static InstanceCredentialsRetryPolicy getInstance() { 9 | if (null == instance) { 10 | instance = new InstanceCredentialsRetryPolicy(); 11 | } 12 | 13 | return instance; 14 | } 15 | 16 | private InstanceCredentialsRetryPolicy() { 17 | } 18 | 19 | @Override 20 | public boolean shouldRetry(int attemptedRetries, CredentialsEndpointRetryParameters retryParameters) { 21 | return false; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/DefaultClientAbortTaskImpl.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal; 2 | 3 | import org.apache.http.client.methods.HttpRequestBase; 4 | 5 | public class DefaultClientAbortTaskImpl implements CosClientAbortTaskMonitor { 6 | public static final DefaultClientAbortTaskImpl INSTANCE = new DefaultClientAbortTaskImpl(); 7 | 8 | private DefaultClientAbortTaskImpl() {} 9 | 10 | @Override 11 | public void setCurrentHttpRequest(HttpRequestBase newRequest) { 12 | } 13 | 14 | @Override 15 | public boolean hasTimeoutExpired() { 16 | return false; 17 | } 18 | 19 | @Override 20 | public boolean isEnabled() { 21 | return false; 22 | } 23 | 24 | @Override 25 | public void cancelTask() { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/FrameEnhance.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class FrameEnhance { 6 | @XStreamAlias("FrameDoubling") 7 | private String frameDoubling; 8 | 9 | public String getFrameDoubling() { 10 | return frameDoubling; 11 | } 12 | 13 | public void setFrameDoubling(String frameDoubling) { 14 | this.frameDoubling = frameDoubling; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | final StringBuffer sb = new StringBuffer("FrameEnhance{"); 20 | sb.append("frameDoubling='").append(frameDoubling).append('\''); 21 | sb.append('}'); 22 | return sb.toString(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/VideoTag.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class VideoTag { 6 | /** 7 | * 场景类型,可选择视频标签的运用场景,不同的运用场景使用的算法、输入输出等都会有所差异 8 | * 当前版本只适配 Stream 场景 9 | */ 10 | @XStreamAlias("Scenario") 11 | private String scenario; 12 | @XStreamAlias("Text") 13 | private String text; 14 | 15 | public String getText() { 16 | return text; 17 | } 18 | 19 | public void setText(String text) { 20 | this.text = text; 21 | } 22 | 23 | public String getScenario() { 24 | return scenario; 25 | } 26 | 27 | public void setScenario(String scenario) { 28 | this.scenario = scenario; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/utils/CICheckUtils.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.utils; 2 | 3 | import com.qcloud.cos.model.PutObjectRequest; 4 | import com.qcloud.cos.model.ciModel.persistence.PicOperations; 5 | 6 | public class CICheckUtils { 7 | 8 | /** 9 | * 校验是否为上传覆盖原图请求 10 | * 11 | * @param putObjectRequest 上传内容请求 12 | */ 13 | public static boolean isCoverImageRequest(PutObjectRequest putObjectRequest) { 14 | PicOperations picOperations = putObjectRequest.getPicOperations(); 15 | if (picOperations != null && picOperations.getRules() != null) { 16 | for (PicOperations.Rule rule : picOperations.getRules()) { 17 | return true; 18 | } 19 | } 20 | return false; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DeleteDatasetRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | 12 | public class DeleteDatasetRequest extends CIServiceRequest { 13 | 14 | /** 15 | *数据集名称,同一个账户下唯一。;是否必传:是 16 | */ 17 | private String datasetName; 18 | 19 | public String getDatasetName() { return datasetName; } 20 | 21 | public void setDatasetName(String datasetName) { this.datasetName = datasetName; } 22 | 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/COSDefaultAclHeaderHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal; 2 | 3 | import com.qcloud.cos.Headers; 4 | import com.qcloud.cos.http.CosHttpResponse; 5 | import com.qcloud.cos.model.AccessControlList; 6 | import com.qcloud.cos.model.CannedAccessControlList; 7 | 8 | import java.util.Map; 9 | 10 | public class COSDefaultAclHeaderHandler implements HeaderHandler { 11 | @Override 12 | public void handle(AccessControlList result, CosHttpResponse response) { 13 | Map headers = response.getHeaders(); 14 | if(headers.containsKey(Headers.COS_CANNED_ACL) && 15 | headers.get(Headers.COS_CANNED_ACL).equals(CannedAccessControlList.Default.toString())) { 16 | result.setExistDefaultAcl(true); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/DownloadConfig.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class DownloadConfig { 9 | 10 | @XStreamAlias("Prefix") 11 | private String prefix; 12 | 13 | @XStreamImplicit(itemFieldName = "key") 14 | private List keys; 15 | 16 | public String getPrefix() { 17 | return prefix; 18 | } 19 | 20 | public void setPrefix(String prefix) { 21 | this.prefix = prefix; 22 | } 23 | 24 | public List getKeys() { 25 | return keys; 26 | } 27 | 28 | public void setKeys(List keys) { 29 | this.keys = keys; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/CodecUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | public class CodecUtilsTest { 8 | @Test 9 | public void testCodecUtils() throws Exception { 10 | String str = "hello world"; 11 | byte[] str_bytes = new byte[str.length()]; 12 | int limit = CodecUtils.sanitize(str, str_bytes); 13 | assertEquals(str.length() - 1, limit); 14 | 15 | byte[] str_bytes2 = CodecUtils.toBytesDirect(str); 16 | String str2 = CodecUtils.toStringDirect(str_bytes2); 17 | assertEquals(str, str2); 18 | 19 | assertEquals(null, CodecUtils.convertFromUtf8ToIso88591(null)); 20 | assertEquals(null, CodecUtils.convertFromIso88591ToUtf8(null)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/auth/HttpCredentialsEndpointProvider.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.auth; 2 | 3 | import java.net.URI; 4 | import java.net.URISyntaxException; 5 | import java.util.Map; 6 | 7 | public class HttpCredentialsEndpointProvider extends CredentialsEndpointProvider{ 8 | private final String url; 9 | private final String path; 10 | private final Map header; 11 | 12 | public HttpCredentialsEndpointProvider(String url, String path, Map header) { 13 | this.url = url; 14 | this.path = path; 15 | this.header = header; 16 | } 17 | 18 | @Override 19 | public URI getCredentialsEndpoint() throws URISyntaxException { 20 | return new URI(url + path); 21 | } 22 | 23 | @Override 24 | public Map getHeaders() { 25 | return header; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/VocalScore.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("VocalScore") 6 | public class VocalScore { 7 | 8 | @XStreamAlias("StandardObject") 9 | private String standardObject; 10 | 11 | @XStreamAlias("StandardUrl") 12 | private String standardUrl; 13 | 14 | public String getStandardObject() { 15 | return standardObject; 16 | } 17 | 18 | public void setStandardObject(String standardObject) { 19 | this.standardObject = standardObject; 20 | } 21 | 22 | public String getStandardUrl() { 23 | return standardUrl; 24 | } 25 | 26 | public void setStandardUrl(String standardUrl) { 27 | this.standardUrl = standardUrl; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/MediaJobType.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public enum MediaJobType { 4 | 5 | Porn("涉黄", 1), 6 | Terrorism("涉暴恐", 2), 7 | Politics("政治敏感", 3), 8 | Ads("广告", 4), 9 | Illegal("违法", 5), 10 | Abuse("谩骂", 6), 11 | Teenager("未成年人", 7); 12 | 13 | private int type; 14 | private String name; 15 | 16 | MediaJobType(String name, int index) { 17 | this.name = name; 18 | this.type = index; 19 | } 20 | 21 | public int getType() { 22 | return type; 23 | } 24 | 25 | public void setType(int type) { 26 | this.type = type; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/VocalScoreResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("VocalScoreResult") 6 | public class VocalScoreResult { 7 | @XStreamAlias("PitchScore") 8 | private PitchScore pitchScore; 9 | @XStreamAlias("RhythemScore") 10 | private RhythemScore rhythemScore; 11 | 12 | public PitchScore getPitchScore() { 13 | return pitchScore; 14 | } 15 | 16 | public void setPitchScore(PitchScore pitchScore) { 17 | this.pitchScore = pitchScore; 18 | } 19 | 20 | public RhythemScore getRhythemScore() { 21 | return rhythemScore; 22 | } 23 | 24 | public void setRhythemScore(RhythemScore rhythemScore) { 25 | this.rhythemScore = rhythemScore; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/inventory/InventoryAndPredicate.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.inventory; 2 | 3 | import com.qcloud.cos.model.Tag.Tag; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class InventoryAndPredicate extends InventoryFilterPredicate { 9 | private String prefix; 10 | 11 | private List tags = new ArrayList<>(); 12 | 13 | public String getPrefix() { 14 | return prefix; 15 | } 16 | 17 | public void setPrefix(String prefix) { 18 | this.prefix = prefix; 19 | } 20 | 21 | public void setTags(List tags) { 22 | this.tags = tags; 23 | } 24 | 25 | public List getTags() { 26 | return tags; 27 | } 28 | 29 | @Override 30 | public void accept(InventoryPredicateVisitor inventoryPredicateVisitor) {} 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/Filter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | public class Filter { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/DetectType.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public enum DetectType { 4 | 5 | Porn("涉黄", 1), 6 | Terrorism("涉暴恐", 2), 7 | Politics("政治敏感", 3), 8 | Ads("广告", 4), 9 | Illegal("违法", 5), 10 | Abuse("谩骂", 6), 11 | Teenager("未成年人", 7); 12 | 13 | private int type; 14 | private String name; 15 | 16 | DetectType(String name, int index) { 17 | this.name = name; 18 | this.type = index; 19 | } 20 | 21 | public int getType() { 22 | return type; 23 | } 24 | 25 | public void setType(int type) { 26 | this.type = type; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/image/ImageInspectRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.image; 2 | 3 | import com.qcloud.cos.internal.CosServiceRequest; 4 | 5 | 6 | public class ImageInspectRequest extends CosServiceRequest { 7 | /** 8 | * 对象在cos中的相对位置,例如 demo/picture.jpg 9 | */ 10 | private String objectKey; 11 | 12 | /** 13 | * 操作的bucket名称 14 | */ 15 | private String bucketName; 16 | 17 | public String getObjectKey() { 18 | return objectKey; 19 | } 20 | 21 | public void setObjectKey(String objectKey) { 22 | this.objectKey = objectKey; 23 | } 24 | 25 | public String getBucketName() { 26 | return bucketName; 27 | } 28 | 29 | public void setBucketName(String bucketName) { 30 | this.bucketName = bucketName; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/MediaResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MediaResult { 6 | @XStreamAlias("OutputFile") 7 | private OutputFile outputFile; 8 | 9 | public OutputFile getOutputFile() { 10 | if (outputFile == null) { 11 | outputFile = new OutputFile(); 12 | } 13 | return outputFile; 14 | } 15 | 16 | public void setOutputFile(OutputFile outputFile) { 17 | this.outputFile = outputFile; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | final StringBuilder sb = new StringBuilder("MediaResult{"); 23 | sb.append("outputFile=").append(outputFile); 24 | sb.append('}'); 25 | return sb.toString(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/demo/ci/GetHLSPlayKeyDemo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.demo.ci; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import com.qcloud.cos.model.ciModel.hls.GetHLSPlayKeyRequest; 5 | import com.qcloud.cos.model.ciModel.hls.GetHLSPlayKeyResponse; 6 | import com.qcloud.cos.utils.Jackson; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 获取hls播放密钥 详情见暂无 12 | */ 13 | public class GetHLSPlayKeyDemo { 14 | 15 | /** 16 | * getHLSPlayKey 该接口用于获取hls播放密钥。 17 | * 该接口属于 GET 请求。 18 | */ 19 | public static void getHLSPlayKey(COSClient client) { 20 | GetHLSPlayKeyRequest request = new GetHLSPlayKeyRequest(); 21 | request.setBucketName("demo-1234567890"); 22 | 23 | GetHLSPlayKeyResponse response = client.getHLSPlayKey(request); 24 | System.out.println(Jackson.toJsonString(response)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/FileProcessJobResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | 7 | /** 8 | * 媒体处理 任务列表响应实体 https://cloud.tencent.com/document/product/460/48234 9 | */ 10 | @XStreamAlias("Response") 11 | public class FileProcessJobResponse extends CiServiceResult { 12 | 13 | @XStreamAlias("JobsDetail") 14 | private FileProcessJobDetail jobDetail; 15 | 16 | public FileProcessJobDetail getJobDetail() { 17 | if (jobDetail == null) { 18 | jobDetail = new FileProcessJobDetail(); 19 | } 20 | return jobDetail; 21 | } 22 | 23 | public void setJobDetail(FileProcessJobDetail jobDetail) { 24 | this.jobDetail = jobDetail; 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/Aggregations.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class Aggregations { 6 | 7 | /** 8 | * 聚合字段的操作符。枚举值:min:最小值。max:最大值。average:平均数sum:求和。count:计数。distinct:去重计数。group:分组计数,按照分组计数结果从高到低排序。 9 | */ 10 | @JsonProperty("Operation") 11 | private String operation; 12 | 13 | /** 14 | *字段名称。关于支持的字段,请参考字段和操作符的支持列表。 15 | */ 16 | @JsonProperty("Field") 17 | private String field; 18 | 19 | public String getOperation() { return operation; } 20 | 21 | public void setOperation(String operation) { this.operation = operation; } 22 | 23 | public String getField() { return field; } 24 | 25 | public void setField(String field) { this.field = field; } 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/AIGCMetadataResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.qcloud.cos.model.CosServiceResult; 5 | 6 | public class AIGCMetadataResponse extends CosServiceResult { 7 | 8 | @JsonProperty("AIGC") 9 | private AigcMetadata AIGC; 10 | 11 | public AigcMetadata getAigc() { 12 | if (AIGC == null) { 13 | AIGC = new AigcMetadata(); 14 | } 15 | return AIGC; 16 | } 17 | 18 | public void setAigc(AigcMetadata aigc) { 19 | this.AIGC = aigc; 20 | } 21 | 22 | public AIGCMetadataResponse() {} 23 | 24 | @Override 25 | public String toString() { 26 | return "AigcMetadataResponse{" + 27 | "aigc=" + AIGC + 28 | '}'; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/MediaJobResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | /** 7 | * 媒体处理 任务响应实体 https://cloud.tencent.com/document/product/460/48234 8 | */ 9 | @XStreamAlias("Response") 10 | public class MediaJobResponse extends CiServiceResult { 11 | @XStreamAlias("JobsDetail") 12 | private MediaJobObject jobsDetail; 13 | 14 | public MediaJobObject getJobsDetail() { 15 | if (jobsDetail==null){ 16 | jobsDetail = new MediaJobObject(); 17 | } 18 | return jobsDetail; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return "MediaJobResponse{" + 24 | "jobsDetail=" + jobsDetail + 25 | '}'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/http/HttpProtocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.http; 20 | 21 | public enum HttpProtocol { 22 | http, https; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/BucketObjectLockConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | public class BucketObjectLockConfiguration { 4 | private String status; 5 | private String retentionMode; 6 | private int retentionDays = -1; 7 | 8 | public void setStatus(String status) { 9 | this.status = status; 10 | } 11 | 12 | public String getStatus() { 13 | return status; 14 | } 15 | 16 | public void setRetentionMode(String retentionMode) { 17 | this.retentionMode = retentionMode; 18 | } 19 | 20 | public String getRetentionMode() { 21 | return retentionMode; 22 | } 23 | 24 | public void setRetentionDays(int retentionDays) { 25 | this.retentionDays = retentionDays; 26 | } 27 | 28 | public int getRetentionDays() { 29 | return retentionDays; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/event/ProgressEventTypeTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.event; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | public class ProgressEventTypeTest { 8 | 9 | @Test 10 | public void isTransferEvent() { 11 | assertTrue(ProgressEventType.TRANSFER_CANCELED_EVENT.isTransferEvent()); 12 | assertFalse(ProgressEventType.CLIENT_REQUEST_FAILED_EVENT.isTransferEvent()); 13 | } 14 | 15 | @Test 16 | public void isRequestCycleEvent() { 17 | assertFalse(ProgressEventType.TRANSFER_CANCELED_EVENT.isRequestCycleEvent()); 18 | } 19 | 20 | @Test 21 | public void isByteCountEvent() { 22 | assertTrue(ProgressEventType.HTTP_REQUEST_CONTENT_RESET_EVENT.isByteCountEvent()); 23 | assertFalse(ProgressEventType.CLIENT_REQUEST_FAILED_EVENT.isByteCountEvent()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/demo/ci/BaseCosImageProcessDemo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.demo.ci; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import com.qcloud.cos.model.ciModel.common.CImageProcessRequest; 5 | 6 | public class BaseCosImageProcessDemo { 7 | public static void main(String[] args) throws Exception { 8 | // 1 初始化用户身份信息(secretId, secretKey)。 9 | COSClient client = ClientUtils.getTestClient(); 10 | // 2 调用要使用的方法。 11 | processImage(client); 12 | } 13 | 14 | public static void processImage(COSClient client){ 15 | String bucketName = "beijingtest-1251704708"; 16 | String key = "1.jpg"; 17 | CImageProcessRequest request = new CImageProcessRequest(bucketName,key); 18 | request.setCiSpecialEndParameter(""); 19 | boolean ciUploadResult = client.processImage2(request); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingAudio.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class AuditingAudio { 4 | private String label; 5 | private String type; 6 | 7 | public String getLabel() { 8 | return label; 9 | } 10 | 11 | public void setLabel(String label) { 12 | this.label = label; 13 | } 14 | 15 | public String getType() { 16 | return type; 17 | } 18 | 19 | public void setType(String type) { 20 | this.type = type; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | final StringBuilder sb = new StringBuilder("AuditingAudio{"); 26 | sb.append("label='").append(label).append('\''); 27 | sb.append(", type='").append(type).append('\''); 28 | sb.append('}'); 29 | return sb.toString(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/ErrorDetail.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class ErrorDetail { 9 | @XStreamAlias("ErrorCount") 10 | private String errorCount; 11 | @XStreamImplicit(itemFieldName = "ErrorFile") 12 | private List errorFile; 13 | 14 | public String getErrorCount() { 15 | return errorCount; 16 | } 17 | 18 | public void setErrorCount(String errorCount) { 19 | this.errorCount = errorCount; 20 | } 21 | 22 | public List getErrorFile() { 23 | return errorFile; 24 | } 25 | 26 | public void setErrorFile(List errorFile) { 27 | this.errorFile = errorFile; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/ObjectTag.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class ObjectTag { 9 | @XStreamImplicit(itemFieldName = "Objects") 10 | private List objects; 11 | 12 | @XStreamAlias("TimeStamp") 13 | private String timeStamp; 14 | 15 | public List getObjects() { 16 | return objects; 17 | } 18 | 19 | public void setObjects(List objects) { 20 | this.objects = objects; 21 | } 22 | 23 | public String getTimeStamp() { 24 | return timeStamp; 25 | } 26 | 27 | public void setTimeStamp(String timeStamp) { 28 | this.timeStamp = timeStamp; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/transfer/PersistableResumeDownloadTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.transfer; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.HashMap; 6 | 7 | import static org.junit.Assert.*; 8 | 9 | public class PersistableResumeDownloadTest { 10 | 11 | @Test 12 | public void getDownloadedBlocks() { 13 | PersistableResumeDownload p = new PersistableResumeDownload(0, null, "etag", null, new HashMap()); 14 | assertEquals("etag", p.getEtag()); 15 | assertNotNull(p.getDownloadedBlocks()); 16 | 17 | p.reset(); 18 | assertFalse(p.hasDownloadedBlocks("any")); 19 | } 20 | 21 | 22 | @Test 23 | public void getLastModified() { 24 | PersistableResumeDownload p = new PersistableResumeDownload(0, null, null, null, null); 25 | assertEquals(0L, p.getLastModified()); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/ReportBadCaseHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import org.xml.sax.Attributes; 4 | 5 | 6 | public class ReportBadCaseHandler extends CIAbstractHandler { 7 | public String requestId = ""; 8 | 9 | @Override 10 | protected void doStartElement(String uri, String name, String qName, Attributes attrs) { 11 | 12 | } 13 | 14 | @Override 15 | protected void doEndElement(String uri, String name, String qName) { 16 | if (in("Response")) { 17 | switch (name) { 18 | case "RequestId": 19 | requestId = getText(); 20 | break; 21 | default: 22 | break; 23 | } 24 | } 25 | } 26 | 27 | public String getResponse() { 28 | return requestId; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/ListInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class ListInfo { 7 | /** 8 | * 用户业务TokenId 9 | */ 10 | private List listResults; 11 | 12 | public List getListResults() { 13 | if (listResults ==null){ 14 | listResults = new ArrayList<>(); 15 | } 16 | return listResults; 17 | } 18 | 19 | public void setListResults(List listResults) { 20 | this.listResults = listResults; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | final StringBuffer sb = new StringBuffer("ListInfo{"); 26 | sb.append("listResults=").append(listResults); 27 | sb.append('}'); 28 | return sb.toString(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/image/AutoTranslationBlockResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.image; 2 | 3 | import com.qcloud.cos.model.CosServiceResult; 4 | 5 | public class AutoTranslationBlockResponse extends CosServiceResult { 6 | /** 7 | * 翻译结果 8 | */ 9 | private String translationResult; 10 | 11 | public String getTranslationResult() { 12 | return translationResult; 13 | } 14 | 15 | public void setTranslationResult(String translationResult) { 16 | this.translationResult = translationResult; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | final StringBuilder sb = new StringBuilder("AutoTranslationBlockResponse{"); 22 | sb.append("translationResult='").append(translationResult).append('\''); 23 | sb.append('}'); 24 | return sb.toString(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/DNADbConfigsRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | 5 | public class DNADbConfigsRequest extends CIServiceRequest { 6 | private String ids; 7 | private String pageNumber; 8 | private String pageSize; 9 | 10 | public String getIds() { 11 | return ids; 12 | } 13 | 14 | public void setIds(String ids) { 15 | this.ids = ids; 16 | } 17 | 18 | public String getPageNumber() { 19 | return pageNumber; 20 | } 21 | 22 | public void setPageNumber(String pageNumber) { 23 | this.pageNumber = pageNumber; 24 | } 25 | 26 | public String getPageSize() { 27 | return pageSize; 28 | } 29 | 30 | public void setPageSize(String pageSize) { 31 | this.pageSize = pageSize; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DeleteDatasetResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class DeleteDatasetResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *数据集信息 19 | */ 20 | private Dataset dataset; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public Dataset getDataset() { return dataset; } 27 | 28 | public void setDataset(Dataset dataset) { this.dataset = dataset; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/UpdateDatasetResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class UpdateDatasetResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *数据集信息 19 | */ 20 | private Dataset dataset; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public Dataset getDataset() { return dataset; } 27 | 28 | public void setDataset(Dataset dataset) { this.dataset = dataset; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/FacePlateMosaicObject.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | 9 | public class FacePlateMosaicObject { 10 | @JsonProperty("is_pic_info") 11 | private int isPicInfo = 1; 12 | private List rules; 13 | 14 | public int getIsPicInfo() { 15 | return isPicInfo; 16 | } 17 | 18 | public void setIsPicInfo(int isPicInfo) { 19 | this.isPicInfo = isPicInfo; 20 | } 21 | 22 | public List getRules() { 23 | if (rules == null) { 24 | rules = new ArrayList<>(); 25 | } 26 | return rules; 27 | } 28 | 29 | public void setRules(List rules) { 30 | this.rules = rules; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/http/HttpMethodName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.http; 20 | 21 | public enum HttpMethodName { 22 | GET, POST, PUT, DELETE, HEAD; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/GenerateQrcodeHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import org.xml.sax.Attributes; 4 | 5 | 6 | public class GenerateQrcodeHandler extends CIAbstractHandler { 7 | public String imageBase64 = ""; 8 | 9 | @Override 10 | protected void doStartElement(String uri, String name, String qName, Attributes attrs) { 11 | 12 | } 13 | 14 | @Override 15 | protected void doEndElement(String uri, String name, String qName) { 16 | if (in("Response")) { 17 | switch (name) { 18 | case "ResultImage": 19 | imageBase64 = getText(); 20 | break; 21 | default: 22 | break; 23 | } 24 | } 25 | } 26 | 27 | public String getResponse() { 28 | return imageBase64; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/LibResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | 4 | public class LibResult { 5 | private String imageId; 6 | private String score; 7 | 8 | public String getImageId() { 9 | return imageId; 10 | } 11 | 12 | public void setImageId(String imageId) { 13 | this.imageId = imageId; 14 | } 15 | 16 | public String getScore() { 17 | return score; 18 | } 19 | 20 | public void setScore(String score) { 21 | this.score = score; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | final StringBuffer sb = new StringBuffer("LibResult{"); 27 | sb.append("imageId='").append(imageId).append('\''); 28 | sb.append(", score='").append(score).append('\''); 29 | sb.append('}'); 30 | return sb.toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/PicProcessRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | 4 | public class PicProcessRequest extends MediaJobsRequest { 5 | 6 | private PicProcessOperation processOperation; 7 | 8 | public void setProcessOperation(PicProcessOperation processOperation) { 9 | this.processOperation = processOperation; 10 | } 11 | 12 | public PicProcessOperation getPicProcessOperation() { 13 | if (processOperation == null) { 14 | processOperation = new PicProcessOperation(); 15 | } 16 | return processOperation; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | final StringBuilder sb = new StringBuilder("PicProcessRequest{"); 22 | sb.append("operation=").append(processOperation); 23 | sb.append('}'); 24 | return sb.toString(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DescribeDatasetResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class DescribeDatasetResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *数据集信息 19 | */ 20 | private Dataset dataset; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public Dataset getDataset() { return dataset; } 27 | 28 | public void setDataset(Dataset dataset) { this.dataset = dataset; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/DocWatermark.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class DocWatermark { 4 | private String type; 5 | private String image; 6 | private String dx; 7 | private String dy; 8 | 9 | public String getType() { 10 | return type; 11 | } 12 | 13 | public void setType(String type) { 14 | this.type = type; 15 | } 16 | 17 | public String getImage() { 18 | return image; 19 | } 20 | 21 | public void setImage(String image) { 22 | this.image = image; 23 | } 24 | 25 | public String getDx() { 26 | return dx; 27 | } 28 | 29 | public void setDx(String dx) { 30 | this.dx = dx; 31 | } 32 | 33 | public String getDy() { 34 | return dy; 35 | } 36 | 37 | public void setDy(String dy) { 38 | this.dy = dy; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/CreateDatasetBindingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class CreateDatasetBindingResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *绑定信息 19 | */ 20 | private Binding binding; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public Binding getBinding() { return binding; } 27 | 28 | public void setBinding(Binding binding) { this.binding = binding; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ParquetInput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | package com.qcloud.cos.model; 18 | 19 | import java.io.Serializable; 20 | 21 | public class ParquetInput implements Serializable { 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/CreateFileMetaIndexResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class CreateFileMetaIndexResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *创建元数据索引的任务ID 19 | */ 20 | private String eventId; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public String getEventId() { return eventId; } 27 | 28 | public void setEventId(String eventId) { this.eventId = eventId; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/auth/CredentialsEndpointRetryPolicy.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.auth; 2 | 3 | public interface CredentialsEndpointRetryPolicy { 4 | CredentialsEndpointRetryPolicy NO_RETRY_POLICY = new CredentialsEndpointRetryPolicy() { 5 | @Override 6 | public boolean shouldRetry(int attemptedRetries, CredentialsEndpointRetryParameters retryParameters) { 7 | return false; 8 | } 9 | }; 10 | 11 | /** 12 | * Checks whether a failed request should be retried; 13 | * 14 | * @param attemptedRetries The number of times the current request has been attempted. 15 | * @param retryParameters the requested error code and exception are wrapped in the retryParameters 16 | * @return True if the failed request should be retried 17 | */ 18 | boolean shouldRetry(int attemptedRetries, CredentialsEndpointRetryParameters retryParameters); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/COSEncryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | import com.qcloud.cos.COS; 22 | 23 | public interface COSEncryption extends COS{ 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/CarLocation.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | public class CarLocation { 4 | /** 5 | * 定位出的车辆的横坐标 6 | */ 7 | private String x; 8 | /** 9 | * 定位出的车辆的横坐标 10 | */ 11 | private String y; 12 | 13 | public String getX() { 14 | return x; 15 | } 16 | 17 | public void setX(String x) { 18 | this.x = x; 19 | } 20 | 21 | public String getY() { 22 | return y; 23 | } 24 | 25 | public void setY(String y) { 26 | this.y = y; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | final StringBuffer sb = new StringBuffer("CarLocation{"); 32 | sb.append("x='").append(x).append('\''); 33 | sb.append(", y='").append(y).append('\''); 34 | sb.append('}'); 35 | return sb.toString(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingRecordInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class AuditingRecordInfo { 4 | private String code; 5 | private String message; 6 | private AuditingCosOutput output; 7 | 8 | public String getCode() { 9 | return code; 10 | } 11 | 12 | public void setCode(String code) { 13 | this.code = code; 14 | } 15 | 16 | public String getMessage() { 17 | return message; 18 | } 19 | 20 | public void setMessage(String message) { 21 | this.message = message; 22 | } 23 | 24 | public AuditingCosOutput getOutput() { 25 | if (output == null) { 26 | output = new AuditingCosOutput(); 27 | } 28 | return output; 29 | } 30 | 31 | public void setOutput(AuditingCosOutput output) { 32 | this.output = output; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/cihandler/AutoTranslationBlockResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.cihandler; 2 | 3 | import com.qcloud.cos.model.ciModel.image.AutoTranslationBlockResponse; 4 | import org.xml.sax.Attributes; 5 | 6 | 7 | public class AutoTranslationBlockResponseHandler extends CIAbstractHandler { 8 | public AutoTranslationBlockResponse response = new AutoTranslationBlockResponse(); 9 | 10 | @Override 11 | protected void doStartElement(String uri, String name, String qName, Attributes attrs) { 12 | 13 | } 14 | 15 | @Override 16 | protected void doEndElement(String uri, String name, String qName) { 17 | if ("TranslationResult".equalsIgnoreCase(name)) { 18 | response.setTranslationResult(getText()); 19 | } 20 | } 21 | 22 | public AutoTranslationBlockResponse getResponse() { 23 | return response; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/ResultsImageAuditingDetail.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class ResultsImageAuditingDetail extends BaseAuditingDetail { 4 | private String url; 5 | private String text; 6 | 7 | public String getUrl() { 8 | return url; 9 | } 10 | 11 | public void setUrl(String url) { 12 | this.url = url; 13 | } 14 | 15 | public String getText() { 16 | return text; 17 | } 18 | 19 | public void setText(String text) { 20 | this.text = text; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | final StringBuffer sb = new StringBuffer("ResultsImageAuditingDetail{"); 26 | sb.append("url='").append(url).append('\''); 27 | sb.append(", text='").append(text).append('\''); 28 | sb.append('}'); 29 | return sb.toString(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/hls/CreateHLSPlayKeyResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.hls; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Response") 7 | public class CreateHLSPlayKeyResponse extends CiServiceResult { 8 | /** 9 | *请求的唯一 ID 10 | */ 11 | @XStreamAlias("RequestId") 12 | private String requestId; 13 | 14 | /** 15 | *保存播放密钥的容器 16 | */ 17 | @XStreamAlias("PlayKeyList") 18 | private PlayKeyList playKeyList; 19 | 20 | public String getRequestId() { return requestId; } 21 | 22 | public void setRequestId(String requestId) { this.requestId = requestId; } 23 | 24 | public PlayKeyList getPlayKeyList() { return playKeyList; } 25 | 26 | public void setPlayKeyList(PlayKeyList playKeyList) { this.playKeyList = playKeyList; } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/hls/GetHLSPlayKeyResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.hls; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Response") 7 | public class GetHLSPlayKeyResponse extends CiServiceResult { 8 | 9 | /** 10 | *请求的唯一 ID 11 | */ 12 | @XStreamAlias("RequestId") 13 | private String requestId; 14 | 15 | /** 16 | *保存播放密钥的容器 17 | */ 18 | @XStreamAlias("PlayKeyList") 19 | private PlayKeyList playKeyList; 20 | 21 | public String getRequestId() { return requestId; } 22 | 23 | public void setRequestId(String requestId) { this.requestId = requestId; } 24 | 25 | public PlayKeyList getPlayKeyList() { return playKeyList; } 26 | 27 | public void setPlayKeyList(PlayKeyList playKeyList) { this.playKeyList = playKeyList; } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/workflow/MediaWorkflowStart.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.workflow; 2 | 3 | public class MediaWorkflowStart { 4 | private String type; 5 | private MediaWorkflowInput input; 6 | 7 | public String getType() { 8 | return type; 9 | } 10 | 11 | public void setType(String type) { 12 | this.type = type; 13 | } 14 | 15 | public MediaWorkflowInput getInput() { 16 | if (input==null){ 17 | input = new MediaWorkflowInput(); 18 | } 19 | return input; 20 | } 21 | 22 | public void setInput(MediaWorkflowInput input) { 23 | this.input = input; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return "MediaWorkflowStart{" + 29 | "type='" + type + '\'' + 30 | ", input=" + input + 31 | '}'; 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/DecompressionResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | import com.qcloud.cos.utils.Jackson; 4 | 5 | import java.io.Serializable; 6 | 7 | public class DecompressionResult implements Serializable { 8 | 9 | private String jobId; 10 | 11 | private String status; 12 | 13 | private String msg; 14 | 15 | public String getJobId() { 16 | return jobId; 17 | } 18 | 19 | public void setJobId(String jobId) { 20 | this.jobId = jobId; 21 | } 22 | 23 | public String getStatus() { 24 | return status; 25 | } 26 | 27 | public void setStatus(String status) { 28 | this.status = status; 29 | } 30 | 31 | public String getMsg() { 32 | return msg; 33 | } 34 | 35 | public void setMsg(String msg) { 36 | this.msg = msg; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return Jackson.toJsonPrettyString(this); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/hls/UpdataHLSPlayKeyResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.hls; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Response") 7 | public class UpdataHLSPlayKeyResponse extends CiServiceResult { 8 | 9 | /** 10 | *请求的唯一 ID 11 | */ 12 | @XStreamAlias("RequestId") 13 | private String requestId; 14 | 15 | /** 16 | *保存播放密钥的容器 17 | */ 18 | @XStreamAlias("PlayKeyList") 19 | private PlayKeyList playKeyList; 20 | 21 | public String getRequestId() { return requestId; } 22 | 23 | public void setRequestId(String requestId) { this.requestId = requestId; } 24 | 25 | public PlayKeyList getPlayKeyList() { return playKeyList; } 26 | 27 | public void setPlayKeyList(PlayKeyList playKeyList) { this.playKeyList = playKeyList; } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/utils/Base64Test.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | public class Base64Test { 8 | @Test 9 | public void testBase64() { 10 | String str = Base64.encodeAsString(null); 11 | assertEquals(null, str); 12 | 13 | assertEquals(null, Base64.encode(null)); 14 | assertEquals(null, Base64.decode((String) null)); 15 | assertEquals(null, Base64.decode((byte[]) null)); 16 | 17 | str = ""; 18 | byte[] bytes_decode = Base64.decode(str); 19 | assertEquals(0, bytes_decode.length); 20 | 21 | str = "hello world"; 22 | byte[] bytes_encode = Base64.encode(str.getBytes()); 23 | bytes_decode = Base64.decode(bytes_encode); 24 | String str_decode = new String(bytes_decode); 25 | assertEquals(str, str_decode); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DescribeDatasetBindingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class DescribeDatasetBindingResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *数据集和 COS Bucket 绑定关系信息的列表。 19 | */ 20 | private Binding binding; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public Binding getBinding() { return binding; } 27 | 28 | public void setBinding(Binding binding) { this.binding = binding; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/demo/ci/UpdataHLSPlayKeyDemo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.demo.ci; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import com.qcloud.cos.model.ciModel.hls.UpdataHLSPlayKeyRequest; 5 | import com.qcloud.cos.model.ciModel.hls.UpdataHLSPlayKeyResponse; 6 | import com.qcloud.cos.utils.Jackson; 7 | 8 | 9 | /** 10 | * 更新hls播放密钥 详情见暂无 11 | */ 12 | public class UpdataHLSPlayKeyDemo { 13 | 14 | /** 15 | * updataHLSPlayKey 该接口用于更新hls播放密钥。 16 | * 该接口属于 PUT 请求。 17 | */ 18 | public static void updataHLSPlayKey(COSClient client) { 19 | UpdataHLSPlayKeyRequest request = new UpdataHLSPlayKeyRequest(); 20 | request.setBucketName("demo-1234567890"); 21 | // 设置备播放密钥;是否必传:是 22 | request.setBackupPlayKey(""); 23 | 24 | UpdataHLSPlayKeyResponse response = client.updataHLSPlayKey(request); 25 | System.out.println(Jackson.toJsonString(response)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/MediaTags.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MediaTags { 6 | @XStreamAlias("Tag") 7 | private String tag; 8 | @XStreamAlias("TagCls") 9 | private String tagCls; 10 | @XStreamAlias("Confidence") 11 | private String confidence; 12 | 13 | public String getTag() { 14 | return tag; 15 | } 16 | 17 | public void setTag(String tag) { 18 | this.tag = tag; 19 | } 20 | 21 | public String getTagCls() { 22 | return tagCls; 23 | } 24 | 25 | public void setTagCls(String tagCls) { 26 | this.tagCls = tagCls; 27 | } 28 | 29 | public String getConfidence() { 30 | return confidence; 31 | } 32 | 33 | public void setConfidence(String confidence) { 34 | this.confidence = confidence; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/Unmarshaller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.internal; 20 | 21 | public interface Unmarshaller { 22 | 23 | public T unmarshall(R in) throws Exception; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/KeyConfig.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class KeyConfig { 6 | @XStreamAlias("Key") 7 | private String key; 8 | @XStreamAlias("Rename") 9 | private String rename; 10 | @XStreamAlias("ImageParams") 11 | private String imageParams; 12 | 13 | public String getImageParams() { 14 | return imageParams; 15 | } 16 | 17 | public void setImageParams(String imageParams) { 18 | this.imageParams = imageParams; 19 | } 20 | 21 | public String getKey() { 22 | return key; 23 | } 24 | 25 | public void setKey(String key) { 26 | this.key = key; 27 | } 28 | 29 | public String getRename() { 30 | return rename; 31 | } 32 | 33 | public void setRename(String rename) { 34 | this.rename = rename; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/MaskInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class MaskInfo { 4 | private AuditingLiveInfo auditingLiveInfo; 5 | private AuditingRecordInfo recordInfo; 6 | 7 | public AuditingLiveInfo getAuditingLiveInfo() { 8 | if (auditingLiveInfo == null) { 9 | auditingLiveInfo = new AuditingLiveInfo(); 10 | } 11 | return auditingLiveInfo; 12 | } 13 | 14 | public void setAuditingLiveInfo(AuditingLiveInfo auditingLiveInfo) { 15 | this.auditingLiveInfo = auditingLiveInfo; 16 | } 17 | 18 | public AuditingRecordInfo getRecordInfo() { 19 | if (recordInfo == null) { 20 | recordInfo = new AuditingRecordInfo(); 21 | } 22 | return recordInfo; 23 | } 24 | 25 | public void setRecordInfo(AuditingRecordInfo recordInfo) { 26 | this.recordInfo = recordInfo; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/Groups.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @XStreamAlias("Groups") 11 | public class Groups { 12 | 13 | /** 14 | * 分组聚合的总个数。 15 | */ 16 | @XStreamAlias("Count") 17 | private Integer count; 18 | 19 | /** 20 | *分组聚合的值。 21 | */ 22 | @XStreamAlias("Value") 23 | private String value; 24 | 25 | public Integer getCount() { return count; } 26 | 27 | public void setCount(Integer count) { this.count = count; } 28 | 29 | public String getValue() { return value; } 30 | 31 | public void setValue(String value) { this.value = value; } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/utils/Codec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.utils; 20 | 21 | interface Codec { 22 | public byte[] encode(byte[] src); 23 | 24 | public byte[] decode(byte[] src, final int length); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/SearchImageResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class SearchImageResponse extends CiServiceResult { 11 | 12 | /** 13 | *图像检索识别结果信息列表。 14 | */ 15 | private List imageResult; 16 | 17 | /** 18 | *请求ID。 19 | */ 20 | private String requestId; 21 | 22 | public List getImageResult() { return imageResult; } 23 | 24 | public void setImageResult(List imageResult) { this.imageResult = imageResult; } 25 | 26 | public String getRequestId() { return requestId; } 27 | 28 | public void setRequestId(String requestId) { this.requestId = requestId; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/IntelligentTiering/IntelligentTieringTransition.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.IntelligentTiering; 2 | 3 | import java.io.Serializable; 4 | 5 | public class IntelligentTieringTransition implements Serializable { 6 | private String accessTier; 7 | 8 | private int days = -1; 9 | 10 | private int requestFrequent = -1; 11 | 12 | public void setAccessTier(String accessTier) { 13 | this.accessTier = accessTier; 14 | } 15 | 16 | public String getAccessTier() { 17 | return accessTier; 18 | } 19 | 20 | public void setDays(int days) { 21 | this.days = days; 22 | } 23 | 24 | public int getDays() { 25 | return days; 26 | } 27 | 28 | public int getRequestFrequent() { 29 | return requestFrequent; 30 | } 31 | 32 | public void setRequestFrequent(int requestFrequent) { 33 | this.requestFrequent = requestFrequent; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/PicProcess.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | public class PicProcess { 4 | private String isPicInfo; 5 | private String processRule; 6 | 7 | public String getIsPicInfo() { 8 | return isPicInfo; 9 | } 10 | 11 | public void setIsPicInfo(String isPicInfo) { 12 | this.isPicInfo = isPicInfo; 13 | } 14 | 15 | public String getProcessRule() { 16 | return processRule; 17 | } 18 | 19 | public void setProcessRule(String processRule) { 20 | this.processRule = processRule; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | final StringBuilder sb = new StringBuilder("PicProcess{"); 26 | sb.append("isPicInfo='").append(isPicInfo).append('\''); 27 | sb.append(", processRule='").append(processRule).append('\''); 28 | sb.append('}'); 29 | return sb.toString(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/COSEncryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos; 20 | 21 | /** 22 | * A marker interface used to check if an instance of COS client is an encryption client. 23 | */ 24 | public interface COSEncryption { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/PersonExDescriptionInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class PersonExDescriptionInfo { 6 | 7 | @XStreamAlias("PersonExDescriptionIndex") 8 | private Integer personExDescriptionIndex; 9 | @XStreamAlias("PersonExDescription") 10 | private String personExDescription; 11 | 12 | public Integer getPersonExDescriptionIndex() { 13 | return personExDescriptionIndex; 14 | } 15 | 16 | public void setPersonExDescriptionIndex(Integer personExDescriptionIndex) { 17 | this.personExDescriptionIndex = personExDescriptionIndex; 18 | } 19 | 20 | public String getPersonExDescription() { 21 | return personExDescription; 22 | } 23 | 24 | public void setPersonExDescription(String personExDescription) { 25 | this.personExDescription = personExDescription; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/TimeInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class TimeInfo { 6 | 7 | @XStreamAlias("Index") 8 | private String index; 9 | @XStreamAlias("PartBegin") 10 | private String partBegin; 11 | @XStreamAlias("PartEnd") 12 | private String partEnd; 13 | 14 | public String getIndex() { 15 | return index; 16 | } 17 | 18 | public void setIndex(String index) { 19 | this.index = index; 20 | } 21 | 22 | public String getPartBegin() { 23 | return partBegin; 24 | } 25 | 26 | public void setPartBegin(String partBegin) { 27 | this.partBegin = partBegin; 28 | } 29 | 30 | public String getPartEnd() { 31 | return partEnd; 32 | } 33 | 34 | public void setPartEnd(String partEnd) { 35 | this.partEnd = partEnd; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DescribeFileMetaIndexResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | 10 | public class DescribeFileMetaIndexResponse extends CiServiceResult { 11 | 12 | /** 13 | *请求ID。 14 | */ 15 | private String requestId; 16 | 17 | /** 18 | *文件元数据的结构体。实际返回的数据可能并不包含该结构体的所有属性,这和您索引该文件时选用的工作流模板配置以及文件本身的内容有关。 19 | */ 20 | private List files; 21 | 22 | public String getRequestId() { return requestId; } 23 | 24 | public void setRequestId(String requestId) { this.requestId = requestId; } 25 | 26 | public List getFiles() { return files; } 27 | 28 | public void setFiles(List files) { this.files = files; } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/DnaConfig.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class DnaConfig { 6 | @XStreamAlias("RuleType") 7 | private String ruleType; 8 | @XStreamAlias("DnaDbId") 9 | private String dnaDbId; 10 | @XStreamAlias("VideoId") 11 | private String videoId; 12 | 13 | public String getRuleType() { 14 | return ruleType; 15 | } 16 | 17 | public void setRuleType(String ruleType) { 18 | this.ruleType = ruleType; 19 | } 20 | 21 | public String getDnaDbId() { 22 | return dnaDbId; 23 | } 24 | 25 | public void setDnaDbId(String dnaDbId) { 26 | this.dnaDbId = dnaDbId; 27 | } 28 | 29 | public String getVideoId() { 30 | return videoId; 31 | } 32 | 33 | public void setVideoId(String videoId) { 34 | this.videoId = videoId; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/ResultInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class ResultInfo { 6 | @XStreamAlias("Name") 7 | private String name; // 识别类型 8 | 9 | @XStreamAlias("Score") 10 | private int score; // 识别的置信度 11 | 12 | @XStreamAlias("Location") 13 | private Location location; // 图中识别到的坐标 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public int getScore() { 24 | return score; 25 | } 26 | 27 | public void setScore(int score) { 28 | this.score = score; 29 | } 30 | 31 | public Location getLocation() { 32 | return location; 33 | } 34 | 35 | public void setLocation(Location location) { 36 | this.location = location; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/SentenceScores.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SentenceScores { 6 | @XStreamAlias("EndTime") 7 | private String endTime; 8 | 9 | @XStreamAlias("Score") 10 | private String score; 11 | 12 | @XStreamAlias("StartTime") 13 | private String startTime; 14 | 15 | public String getEndTime() { 16 | return endTime; 17 | } 18 | 19 | public void setEndTime(String endTime) { 20 | this.endTime = endTime; 21 | } 22 | 23 | public String getScore() { 24 | return score; 25 | } 26 | 27 | public void setScore(String score) { 28 | this.score = score; 29 | } 30 | 31 | public String getStartTime() { 32 | return startTime; 33 | } 34 | 35 | public void setStartTime(String startTime) { 36 | this.startTime = startTime; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/CIPicServiceRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 腾讯云, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"). 7 | * You may not use this file except in compliance with the License. 8 | * A copy of the License is located at 9 | * 10 | * http://aws.amazon.com/apache2.0 11 | * 12 | * or in the "license" file accompanying this file. This file is distributed 13 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 14 | * express or implied. See the License for the specific language governing 15 | * permissions and limitations under the License. 16 | 17 | * According to ci feature, we modify some class,comment, field name, etc. 18 | */ 19 | 20 | package com.qcloud.cos.internal; 21 | 22 | public class CIPicServiceRequest extends CIServiceRequest { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/DocumentAuditingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | 4 | import com.qcloud.cos.model.CiServiceResult; 5 | 6 | /** 7 | * 文档审核响应实体 8 | */ 9 | public class DocumentAuditingResponse extends CiServiceResult { 10 | private DocumentAuditingJobsDetail jobsDetail; 11 | 12 | public DocumentAuditingJobsDetail getJobsDetail() { 13 | if (jobsDetail == null) { 14 | jobsDetail = new DocumentAuditingJobsDetail(); 15 | } 16 | return jobsDetail; 17 | } 18 | 19 | public void setJobsDetail(DocumentAuditingJobsDetail jobsDetail) { 20 | this.jobsDetail = jobsDetail; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | final StringBuffer sb = new StringBuffer("DocumentAuditingResponse{"); 26 | sb.append("jobsDetail=").append(jobsDetail); 27 | sb.append('}'); 28 | return sb.toString(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/queue/MediaQueueResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.queue; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | public class MediaQueueResponse extends CiServiceResult { 6 | private MediaQueueObject queue; 7 | private String requestId; 8 | 9 | 10 | public MediaQueueObject getQueue() { 11 | if (queue==null){ 12 | queue = new MediaQueueObject(); 13 | } 14 | return queue; 15 | } 16 | 17 | public void setQueue(MediaQueueObject queue) { 18 | this.queue = queue; 19 | } 20 | 21 | public String getRequestId() { 22 | return requestId; 23 | } 24 | 25 | public void setRequestId(String requestId) { 26 | this.requestId = requestId; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "MediaQueueResponse{" + 32 | "queue=" + queue + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/SceneChangeInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SceneChangeInfo { 6 | @XStreamAlias("Mode") 7 | private String mode; 8 | 9 | @XStreamAlias("Time") 10 | private String time; 11 | 12 | @XStreamAlias("TransitionType") 13 | private String transitionType; 14 | 15 | public String getMode() { 16 | return mode; 17 | } 18 | 19 | public void setMode(String mode) { 20 | this.mode = mode; 21 | } 22 | 23 | public String getTime() { 24 | return time; 25 | } 26 | 27 | public void setTime(String time) { 28 | this.time = time; 29 | } 30 | 31 | public String getTransitionType() { 32 | return transitionType; 33 | } 34 | 35 | public void setTransitionType(String transitionType) { 36 | this.transitionType = transitionType; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/MediaSong.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class MediaSong { 6 | @XStreamAlias("Inlier") 7 | private String inlier; 8 | @XStreamAlias("SingerName") 9 | private String singerName; 10 | @XStreamAlias("SongName") 11 | private String songName; 12 | 13 | public String getInlier() { 14 | return inlier; 15 | } 16 | 17 | public void setInlier(String inlier) { 18 | this.inlier = inlier; 19 | } 20 | 21 | public String getSingerName() { 22 | return singerName; 23 | } 24 | 25 | public void setSingerName(String singerName) { 26 | this.singerName = singerName; 27 | } 28 | 29 | public String getSongName() { 30 | return songName; 31 | } 32 | 33 | public void setSongName(String songName) { 34 | this.songName = songName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/demo/ci/CreateHLSPlayKeyDemo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.demo.ci; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import com.qcloud.cos.model.ciModel.hls.CreateHLSPlayKeyRequest; 5 | import com.qcloud.cos.model.ciModel.hls.CreateHLSPlayKeyResponse; 6 | import com.qcloud.cos.utils.Jackson; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 生成hls播放密钥 详情见暂无 12 | */ 13 | public class CreateHLSPlayKeyDemo { 14 | 15 | public static void main(String[] args) { 16 | // 2 调用要使用的方法。 17 | } 18 | 19 | /** 20 | * createHLSPlayKey 该接口用于生成hls播放密钥。 21 | * 该接口属于 POST 请求。 22 | */ 23 | public static void createHLSPlayKey(COSClient client) { 24 | CreateHLSPlayKeyRequest request = new CreateHLSPlayKeyRequest(); 25 | request.setBucketName("demo-1234567890"); 26 | 27 | CreateHLSPlayKeyResponse response = client.createHLSPlayKey(request); 28 | System.out.println(Jackson.toJsonString(response)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/CIWorkflowServiceRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 腾讯云, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"). 7 | * You may not use this file except in compliance with the License. 8 | * A copy of the License is located at 9 | * 10 | * http://aws.amazon.com/apache2.0 11 | * 12 | * or in the "license" file accompanying this file. This file is distributed 13 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 14 | * express or implied. See the License for the specific language governing 15 | * permissions and limitations under the License. 16 | 17 | * According to ci feature, we modify some class,comment, field name, etc. 18 | */ 19 | 20 | package com.qcloud.cos.internal; 21 | 22 | public class CIWorkflowServiceRequest extends CIServiceRequest { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/SentimentAnalysis.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SentimentAnalysis { 6 | @XStreamAlias("Label") 7 | private String label; 8 | @XStreamAlias("Score") 9 | private Integer Score; 10 | @XStreamAlias("Detail") 11 | private SentimentAnalysisDetail detail; 12 | 13 | public String getLabel() { 14 | return label; 15 | } 16 | 17 | public void setLabel(String label) { 18 | this.label = label; 19 | } 20 | 21 | public Integer getScore() { 22 | return Score; 23 | } 24 | 25 | public void setScore(Integer score) { 26 | Score = score; 27 | } 28 | 29 | public SentimentAnalysisDetail getDetail() { 30 | return detail; 31 | } 32 | 33 | public void setDetail(SentimentAnalysisDetail detail) { 34 | this.detail = detail; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/TranslationOutput.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("Output") 6 | public class TranslationOutput { 7 | @XStreamAlias("Region") 8 | private String region; 9 | 10 | @XStreamAlias("Bucket") 11 | private String bucket; 12 | 13 | @XStreamAlias("Object") 14 | private String object; 15 | 16 | public String getObject() { 17 | return object; 18 | } 19 | 20 | public void setObject(String object) { 21 | this.object = object; 22 | } 23 | 24 | public String getBucket() { 25 | return bucket; 26 | } 27 | 28 | public void setBucket(String bucket) { 29 | this.bucket = bucket; 30 | } 31 | 32 | public String getRegion() { 33 | return region; 34 | } 35 | 36 | public void setRegion(String region) { 37 | this.region = region; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingStrategyResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | @XStreamAlias("Response") 7 | public class AuditingStrategyResponse extends CiServiceResult { 8 | @XStreamAlias("BizType") 9 | private String bizType; 10 | @XStreamAlias("Strategy") 11 | private AuditingStrategy strategy; 12 | 13 | public AuditingStrategy getStrategy() { 14 | if (strategy == null) { 15 | strategy = new AuditingStrategy(); 16 | } 17 | return strategy; 18 | } 19 | 20 | public void setStrategy(AuditingStrategy strategy) { 21 | this.strategy = strategy; 22 | } 23 | 24 | 25 | public String getBizType() { 26 | return bizType; 27 | } 28 | 29 | public void setBizType(String bizType) { 30 | this.bizType = bizType; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/HeadBucketRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | public class HeadBucketRequest extends GenericBucketRequest { 22 | 23 | public HeadBucketRequest(String bucketName) { 24 | super(bucketName); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DescribeFileMetaIndexRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.qcloud.cos.internal.CIServiceRequest; 5 | 6 | 7 | public class DescribeFileMetaIndexRequest extends CIServiceRequest { 8 | 9 | /** 10 | *数据集名称,同一个账户下唯一。;是否必传:是 11 | */ 12 | private String datasetname; 13 | 14 | /** 15 | *资源标识字段,表示需要建立索引的文件地址,当前仅支持COS上的文件,字段规则:cos:///,其中BucketName表示COS存储桶名称,ObjectKey表示文件完整路径,例如:cos://examplebucket-1250000000/test1/img.jpg。 注意: 1、仅支持本账号内的COS文件 2、不支持HTTP开头的地址 3、需UrlEncode;是否必传:是 16 | */ 17 | private String uri; 18 | 19 | public String getDatasetname() { return datasetname; } 20 | 21 | public void setDatasetname(String datasetname) { this.datasetname = datasetname; } 22 | 23 | public String getUri() { return uri; } 24 | 25 | public void setUri(String uri) { this.uri = uri; } 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/persistence/FailedMessage.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.persistence; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class FailedMessage { 6 | @XStreamAlias("State") 7 | private String state; 8 | 9 | @XStreamAlias("ErrorCode") 10 | private String errorCode; 11 | 12 | @XStreamAlias("ErrorMsg") 13 | private String errorMsg; 14 | 15 | public String getState() { 16 | return state; 17 | } 18 | 19 | public void setState(String state) { 20 | this.state = state; 21 | } 22 | 23 | public String getErrorCode() { 24 | return errorCode; 25 | } 26 | 27 | public void setErrorCode(String errorCode) { 28 | this.errorCode = errorCode; 29 | } 30 | 31 | public String getErrorMsg() { 32 | return errorMsg; 33 | } 34 | 35 | public void setErrorMsg(String errorMsg) { 36 | this.errorMsg = errorMsg; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/MediaJobResponseV2.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | /** 7 | * 媒体处理 任务响应实体 https://cloud.tencent.com/document/product/460/48234 8 | */ 9 | @XStreamAlias("Response") 10 | public class MediaJobResponseV2 extends CiServiceResult { 11 | @XStreamAlias("JobsDetail") 12 | private MediaJobObject jobsDetail; 13 | 14 | public MediaJobObject getJobsDetail() { 15 | if (jobsDetail == null) { 16 | jobsDetail = new MediaJobObject(); 17 | } 18 | return jobsDetail; 19 | } 20 | 21 | public void setJobsDetail(MediaJobObject jobsDetail) { 22 | this.jobsDetail = jobsDetail; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "MediaJobResponse{" + 28 | "jobsDetail=" + jobsDetail + 29 | '}'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/image/ImageStyleResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.image; 2 | 3 | 4 | import com.qcloud.cos.internal.CIPicServiceRequest; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class ImageStyleResponse extends CIPicServiceRequest { 10 | /** 11 | * bucket信息 12 | */ 13 | private String bucketName; 14 | 15 | /** 16 | * 样式规则 17 | */ 18 | private List styleRule; 19 | 20 | 21 | public String getBucketName() { 22 | return bucketName; 23 | } 24 | 25 | public void setBucketName(String bucketName) { 26 | this.bucketName = bucketName; 27 | } 28 | 29 | public List getStyleRule() { 30 | if (styleRule == null) { 31 | styleRule = new ArrayList<>(); 32 | } 33 | return styleRule; 34 | } 35 | 36 | public void setStyleRule(List styleRule) { 37 | this.styleRule = styleRule; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/snapshot/SnapshotResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.snapshot; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.qcloud.cos.model.ciModel.common.MediaOutputObject; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 媒体截图请求实体 详情见:https://cloud.tencent.com/document/product/460/38934 10 | */ 11 | public class SnapshotResponse extends CiServiceResult implements Serializable { 12 | /** 13 | * 截图保存的位置信息 14 | */ 15 | private MediaOutputObject output; 16 | 17 | public MediaOutputObject getOutput() { 18 | if (output==null) 19 | this.output = new MediaOutputObject(); 20 | return output; 21 | } 22 | 23 | public void setOutput(MediaOutputObject output) { 24 | this.output = output; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return "SnapshotResponse{" + 30 | "output=" + output + 31 | '}'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/auth/COSSessionCredentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.auth; 20 | 21 | public interface COSSessionCredentials extends COSCredentials { 22 | 23 | /** 24 | * Returns the session token for this session. 25 | */ 26 | public String getSessionToken(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/ReadLimitInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.internal; 20 | 21 | public interface ReadLimitInfo { 22 | /** 23 | * Returns the read limit for mark-and-reset during retries; or -1 if not 24 | * available. 25 | */ 26 | public int getReadLimit(); 27 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/image/StyleRule.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.image; 2 | 3 | public class StyleRule { 4 | /** 5 | * 样式名称 6 | */ 7 | private String styleName; 8 | /** 9 | * 样式详情 10 | */ 11 | private String styleBody; 12 | 13 | public String getStyleName() { 14 | return styleName; 15 | } 16 | 17 | public void setStyleName(String styleName) { 18 | this.styleName = styleName; 19 | } 20 | 21 | public String getStyleBody() { 22 | return styleBody; 23 | } 24 | 25 | public void setStyleBody(String styleBody) { 26 | this.styleBody = styleBody; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | final StringBuffer sb = new StringBuffer("StyleRule{"); 32 | sb.append("styleName='").append(styleName).append('\''); 33 | sb.append(", styleBody='").append(styleBody).append('\''); 34 | sb.append('}'); 35 | return sb.toString(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/workflow/AttachParam.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.workflow; 2 | 3 | import com.qcloud.cos.model.ciModel.template.MediaWatermark; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | public class AttachParam { 7 | @XStreamAlias("Watermark") 8 | private MediaWatermark watermark; 9 | 10 | @XStreamAlias("WatermarkTemplateId") 11 | private String watermarkTemplateId; 12 | 13 | public MediaWatermark getWatermark() { 14 | if (watermark == null) { 15 | watermark = new MediaWatermark(); 16 | } 17 | return watermark; 18 | } 19 | 20 | public void setWatermark(MediaWatermark watermark) { 21 | this.watermark = watermark; 22 | } 23 | 24 | public String getWatermarkTemplateId() { 25 | return watermarkTemplateId; 26 | } 27 | 28 | public void setWatermarkTemplateId(String watermarkTemplateId) { 29 | this.watermarkTemplateId = watermarkTemplateId; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/PutSymlinkResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class PutSymlinkResult implements Serializable { 6 | private static final long serialVersionUID = -934810592067265549L; 7 | 8 | // x-cos-storage-class 9 | private String storageClass; 10 | 11 | // x-cos-request-id 12 | private String requestId; 13 | 14 | // ETag 15 | private String ETag; 16 | 17 | public String getStorageClass() { 18 | return storageClass; 19 | } 20 | 21 | public void setStorageClass(String storageClass) { 22 | this.storageClass = storageClass; 23 | } 24 | 25 | public String getRequestId() { 26 | return requestId; 27 | } 28 | 29 | public void setRequestId(String requestId) { 30 | this.requestId = requestId; 31 | } 32 | 33 | public String getETag() { 34 | return ETag; 35 | } 36 | 37 | public void setETag(String ETag) { 38 | this.ETag = ETag; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AudioAuditingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | /** 6 | * 音频审核响应实体 参数详情参考:https://cloud.tencent.com/document/product/460/53396 7 | */ 8 | public class AudioAuditingResponse extends CiServiceResult { 9 | /** 10 | * 任务的详细信息 11 | */ 12 | private AuditingJobsDetail jobsDetail; 13 | 14 | public AuditingJobsDetail getJobsDetail() { 15 | if (jobsDetail == null) { 16 | jobsDetail = new AuditingJobsDetail(); 17 | } 18 | return jobsDetail; 19 | } 20 | 21 | public void setJobsDetail(AuditingJobsDetail jobsDetail) { 22 | this.jobsDetail = jobsDetail; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | final StringBuffer sb = new StringBuffer("AudioAuditingResponse{"); 28 | sb.append("jobsDetail=").append(jobsDetail); 29 | sb.append('}'); 30 | return sb.toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/VideoAuditingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | /** 6 | * 视频审核响应实体 参数详情参考:https://cloud.tencent.com/document/product/460/37318 7 | */ 8 | public class VideoAuditingResponse extends CiServiceResult { 9 | /** 10 | * 任务的详细信息 11 | */ 12 | private AuditingJobsDetail jobsDetail; 13 | 14 | public AuditingJobsDetail getJobsDetail() { 15 | if (jobsDetail == null) { 16 | jobsDetail = new AuditingJobsDetail(); 17 | } 18 | return jobsDetail; 19 | } 20 | 21 | public void setJobsDetail(AuditingJobsDetail jobsDetail) { 22 | this.jobsDetail = jobsDetail; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | final StringBuffer sb = new StringBuffer("VideoAuditingResponse{"); 28 | sb.append("jobsDetail=").append(jobsDetail); 29 | sb.append('}'); 30 | return sb.toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/BBox.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class BBox { 6 | @XStreamAlias("X1") 7 | private String x1; 8 | @XStreamAlias("Y1") 9 | private String y1; 10 | @XStreamAlias("X2") 11 | private String x2; 12 | @XStreamAlias("Y2") 13 | private String y2; 14 | 15 | public String getX1() { 16 | return x1; 17 | } 18 | 19 | public void setX1(String x1) { 20 | this.x1 = x1; 21 | } 22 | 23 | public String getY1() { 24 | return y1; 25 | } 26 | 27 | public void setY1(String y1) { 28 | this.y1 = y1; 29 | } 30 | 31 | public String getX2() { 32 | return x2; 33 | } 34 | 35 | public void setX2(String x2) { 36 | this.x2 = x2; 37 | } 38 | 39 | public String getY2() { 40 | return y2; 41 | } 42 | 43 | public void setY2(String y2) { 44 | this.y2 = y2; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/ImageQualityRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.internal.CosServiceRequest; 4 | 5 | import java.io.Serializable; 6 | 7 | public class ImageQualityRequest extends CosServiceRequest implements Serializable { 8 | 9 | private String bucketName; 10 | 11 | private String objectKey; 12 | 13 | private String ciProcess = "AssessQuality"; 14 | 15 | public String getObjectKey() { 16 | return objectKey; 17 | } 18 | 19 | public void setObjectKey(String objectKey) { 20 | this.objectKey = objectKey; 21 | } 22 | 23 | public String getCiProcess() { 24 | return ciProcess; 25 | } 26 | 27 | public void setCiProcess(String ciProcess) { 28 | this.ciProcess = ciProcess; 29 | } 30 | 31 | public String getBucketName() { 32 | return bucketName; 33 | } 34 | 35 | public void setBucketName(String bucketName) { 36 | this.bucketName = bucketName; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingStrategyListResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | 7 | import java.util.List; 8 | 9 | @XStreamAlias("Response") 10 | public class AuditingStrategyListResponse extends CiServiceResult { 11 | @XStreamAlias("TotalCount") 12 | private String totalCount; 13 | @XStreamImplicit(itemFieldName = "Strategies") 14 | private List strategy; 15 | 16 | public String getTotalCount() { 17 | return totalCount; 18 | } 19 | 20 | public void setTotalCount(String totalCount) { 21 | this.totalCount = totalCount; 22 | } 23 | 24 | public List getStrategy() { 25 | return strategy; 26 | } 27 | 28 | public void setStrategy(List strategy) { 29 | this.strategy = strategy; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/AppendObjectRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | import java.io.File; 4 | import java.io.InputStream; 5 | 6 | public class AppendObjectRequest extends PutObjectRequest { 7 | 8 | private Long position; 9 | 10 | public AppendObjectRequest(String bucketName, String key, File file) { 11 | super(bucketName, key, file); 12 | } 13 | 14 | public AppendObjectRequest(String bucketName, String key, InputStream input) { 15 | this(bucketName, key, input, null); 16 | } 17 | 18 | public AppendObjectRequest(String bucketName, String key, InputStream input, ObjectMetadata metadata) { 19 | super(bucketName, key, input, metadata); 20 | } 21 | 22 | public Long getPosition() { 23 | return position; 24 | } 25 | 26 | public void setPosition(Long position) { 27 | this.position = position; 28 | } 29 | 30 | public AppendObjectRequest withPosition(Long position) { 31 | setPosition(position); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/hls/PlayKeyList.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.hls; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @XStreamAlias("PlayKeyList") 11 | public class PlayKeyList { 12 | 13 | /** 14 | *主播放密钥 15 | */ 16 | @XStreamAlias("MasterPlayKey") 17 | private String masterPlayKey; 18 | 19 | /** 20 | *备播放密钥 21 | */ 22 | @XStreamAlias("BackupPlayKey") 23 | private String backupPlayKey; 24 | 25 | public String getMasterPlayKey() { return masterPlayKey; } 26 | 27 | public void setMasterPlayKey(String masterPlayKey) { this.masterPlayKey = masterPlayKey; } 28 | 29 | public String getBackupPlayKey() { return backupPlayKey; } 30 | 31 | public void setBackupPlayKey(String backupPlayKey) { this.backupPlayKey = backupPlayKey; } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/Md5Info.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class Md5Info { 6 | @XStreamAlias("Md5") 7 | private String md5Info; 8 | @XStreamAlias("ObjectName") 9 | private String objectName; 10 | 11 | public String getMd5Info() { 12 | return md5Info; 13 | } 14 | 15 | public void setMd5Info(String md5Info) { 16 | this.md5Info = md5Info; 17 | } 18 | 19 | public String getObjectName() { 20 | return objectName; 21 | } 22 | 23 | public void setObjectName(String objectName) { 24 | this.objectName = objectName; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | final StringBuilder sb = new StringBuilder("Md5Info{"); 30 | sb.append("md5Info='").append(md5Info).append('\''); 31 | sb.append(", objectName='").append(objectName).append('\''); 32 | sb.append('}'); 33 | return sb.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/BodyRecognitionResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class BodyRecognitionResult { 9 | /** 10 | * 混合置信度 11 | */ 12 | @XStreamAlias("FusionScore") 13 | private String fusionScore; 14 | 15 | /** 16 | * 识别结果 17 | */ 18 | @XStreamImplicit(itemFieldName = "ResultDetails") 19 | private List resultDetails; 20 | 21 | public String getFusionScore() { 22 | return fusionScore; 23 | } 24 | 25 | public void setFusionScore(String fusionScore) { 26 | this.fusionScore = fusionScore; 27 | } 28 | 29 | public List getResultDetails() { 30 | return resultDetails; 31 | } 32 | 33 | public void setResultDetails(List resultDetails) { 34 | this.resultDetails = resultDetails; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/workflow/SpriteObjectInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.workflow; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | @XStreamAlias("SpriteObjectInfo") 6 | public class SpriteObjectInfo { 7 | @XStreamAlias("ObjectName") 8 | private String objectName; 9 | 10 | @XStreamAlias("ObjectUrl") 11 | private String objectUrl; 12 | 13 | public String getObjectUrl() { 14 | return objectUrl; 15 | } 16 | 17 | public void setObjectUrl(String objectUrl) { 18 | this.objectUrl = objectUrl; 19 | } 20 | 21 | public String getObjectName() { 22 | return objectName; 23 | } 24 | 25 | public void setObjectName(String objectName) { 26 | this.objectName = objectName; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "SpriteObjectInfo{" + 32 | "objectName='" + objectName + '\'' + 33 | ", objectUrl='" + objectUrl + '\'' + 34 | '}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/demo/ci/ImageQualityDemo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.demo.ci; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import com.qcloud.cos.model.ciModel.job.ImageQualityRequest; 5 | import com.qcloud.cos.model.ciModel.job.ImageQualityResponse; 6 | 7 | /* 8 | * 图片质量评估相关demo https://cloud.tencent.com/document/product/460/63228 9 | */ 10 | public class ImageQualityDemo { 11 | public static void main(String[] args) { 12 | // 1. 初始化客户端 13 | COSClient client = ClientUtils.getTestClient(); 14 | assessImageQuality(client); 15 | } 16 | 17 | public static void assessImageQuality(COSClient client) { 18 | // 1. 创建请求对象 19 | ImageQualityRequest request = new ImageQualityRequest(); 20 | 21 | // 2. 设置请求参数 22 | request.setBucketName("demobucket-1251704708"); 23 | request.setObjectKey("demo.jpeg"); 24 | 25 | // 3. 发起GET请求,返回结果 26 | ImageQualityResponse response = client.AccessImageQulity(request); 27 | System.out.println(response.getRequestId()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/VqaPlusResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class VqaPlusResult { 7 | private String noAudio; 8 | private String noVideo; 9 | private List detailedResults; 10 | 11 | public String getNoAudio() { 12 | return noAudio; 13 | } 14 | 15 | public void setNoAudio(String noAudio) { 16 | this.noAudio = noAudio; 17 | } 18 | 19 | public String getNoVideo() { 20 | return noVideo; 21 | } 22 | 23 | public void setNoVideo(String noVideo) { 24 | this.noVideo = noVideo; 25 | } 26 | 27 | public List getDetailedResults() { 28 | if (detailedResults == null) { 29 | detailedResults = new ArrayList<>(); 30 | } 31 | return detailedResults; 32 | } 33 | 34 | public void setDetailedResults(List detailedResults) { 35 | this.detailedResults = detailedResults; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/DeleteBucketReplicationConfigurationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | public class DeleteBucketReplicationConfigurationRequest extends GenericBucketRequest { 22 | public DeleteBucketReplicationConfigurationRequest(String bucketName) { 23 | super(bucketName); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/GetBucketReplicationConfigurationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | public class GetBucketReplicationConfigurationRequest extends GenericBucketRequest { 22 | 23 | public GetBucketReplicationConfigurationRequest(String bucketName) { 24 | super(bucketName); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/ObjectTagInfo.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class ObjectTagInfo { 9 | @XStreamAlias("Name") 10 | private String name; 11 | @XStreamAlias("Confidence") 12 | private String confidence; 13 | 14 | @XStreamImplicit(itemFieldName = "BBox") 15 | private List bbox; 16 | 17 | public List getBbox() { 18 | return bbox; 19 | } 20 | 21 | public void setBbox(List bbox) { 22 | this.bbox = bbox; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | 33 | public String getConfidence() { 34 | return confidence; 35 | } 36 | 37 | public void setConfidence(String confidence) { 38 | this.confidence = confidence; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/inventory/InventoryEncryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | package com.qcloud.cos.model.inventory; 18 | 19 | /** 20 | * Interface for different types of encryption options for bucket inventories. See {@link ServerSideEncryptionCOS} 21 | * for implementations. 22 | */ 23 | public interface InventoryEncryption { 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/FileHashCodeConfig.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class FileHashCodeConfig { 6 | @XStreamAlias("Type") 7 | private String type; 8 | 9 | @XStreamAlias("AddToHeader") 10 | private String addToHeader; 11 | 12 | public String getType() { 13 | return type; 14 | } 15 | 16 | public void setType(String type) { 17 | this.type = type; 18 | } 19 | 20 | public String getAddToHeader() { 21 | return addToHeader; 22 | } 23 | 24 | public void setAddToHeader(String addToHeader) { 25 | this.addToHeader = addToHeader; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | final StringBuffer sb = new StringBuffer("FileHashCodeConfig{"); 31 | sb.append("type='").append(type).append('\''); 32 | sb.append(", addToHeader='").append(addToHeader).append('\''); 33 | sb.append('}'); 34 | return sb.toString(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/image/OpenImageSearchRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.image; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | 5 | public class OpenImageSearchRequest extends CIServiceRequest { 6 | /** 7 | * 操作的bucket名称 8 | */ 9 | private String bucketName; 10 | /** 11 | * 图库容量限制 12 | */ 13 | private String maxCapacity; 14 | /** 15 | * 图库访问限制,默认10 16 | */ 17 | private String maxQps; 18 | 19 | public String getBucketName() { 20 | return bucketName; 21 | } 22 | 23 | public void setBucketName(String bucketName) { 24 | this.bucketName = bucketName; 25 | } 26 | 27 | public String getMaxCapacity() { 28 | return maxCapacity; 29 | } 30 | 31 | public void setMaxCapacity(String maxCapacity) { 32 | this.maxCapacity = maxCapacity; 33 | } 34 | 35 | public String getMaxQps() { 36 | return maxQps; 37 | } 38 | 39 | public void setMaxQps(String maxQps) { 40 | this.maxQps = maxQps; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/StreamData.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class StreamData { 6 | @XStreamAlias("Data") 7 | private VideoTagData data; 8 | @XStreamAlias("SubErrCode") 9 | private String subErrCode; 10 | @XStreamAlias("SubErrMsg") 11 | private String subErrMsg; 12 | 13 | public VideoTagData getData() { 14 | if (data == null) { 15 | data = new VideoTagData(); 16 | } 17 | return data; 18 | } 19 | 20 | public void setData(VideoTagData data) { 21 | this.data = data; 22 | } 23 | 24 | public String getSubErrCode() { 25 | return subErrCode; 26 | } 27 | 28 | public void setSubErrCode(String subErrCode) { 29 | this.subErrCode = subErrCode; 30 | } 31 | 32 | public String getSubErrMsg() { 33 | return subErrMsg; 34 | } 35 | 36 | public void setSubErrMsg(String subErrMsg) { 37 | this.subErrMsg = subErrMsg; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/template/MediaHlsEncryptObject.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.template; 2 | 3 | 4 | public class MediaHlsEncryptObject { 5 | 6 | /** 7 | * 是否开启 HLS 加密 8 | * 1. true/false 9 | * 2. Segment.Format 为 HLS 时支持加密 10 | */ 11 | private String isHlsEncrypt; 12 | /** 13 | * 当 IsHlsEncrypt 为 true 时,该参数才有意义 14 | */ 15 | private String uriKey; 16 | 17 | public String getIsHlsEncrypt() { 18 | return isHlsEncrypt; 19 | } 20 | 21 | public void setIsHlsEncrypt(String isHlsEncrypt) { 22 | this.isHlsEncrypt = isHlsEncrypt; 23 | } 24 | 25 | public String getUriKey() { 26 | return uriKey; 27 | } 28 | 29 | public void setUriKey(String uriKey) { 30 | this.uriKey = uriKey; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return "MediaHlsEncryptObject{" + 36 | "isHlsEncrypt='" + isHlsEncrypt + '\'' + 37 | ", uriKey='" + uriKey + '\'' + 38 | '}'; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/GetBucketLocationRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | 22 | /* 23 | * Get The Location Of the Bucket 24 | */ 25 | public class GetBucketLocationRequest extends GenericBucketRequest { 26 | 27 | public GetBucketLocationRequest(String bucketName) { 28 | super(bucketName); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/ZipPreviewRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job; 2 | 3 | import com.qcloud.cos.internal.CosServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | 6 | /** 7 | * 文件处理请求类 8 | */ 9 | @XStreamAlias("Request") 10 | public class ZipPreviewRequest extends CosServiceRequest { 11 | private String bucketName; 12 | private String objectKey; 13 | private String uncompressKey; 14 | 15 | public String getBucketName() { 16 | return bucketName; 17 | } 18 | 19 | public void setBucketName(String bucketName) { 20 | this.bucketName = bucketName; 21 | } 22 | 23 | public String getObjectKey() { 24 | return objectKey; 25 | } 26 | 27 | public void setObjectKey(String objectKey) { 28 | this.objectKey = objectKey; 29 | } 30 | 31 | public String getUncompressKey() { 32 | return uncompressKey; 33 | } 34 | 35 | public void setUncompressKey(String uncompressKey) { 36 | this.uncompressKey = uncompressKey; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/mediaInfo/MediaInfoResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.mediaInfo; 2 | 3 | 4 | import com.qcloud.cos.model.CiServiceResult; 5 | import com.thoughtworks.xstream.annotations.XStreamAlias; 6 | 7 | /** 8 | * MediaInfo 媒体信息返回包装类 详情见:https://cloud.tencent.com/document/product/460/38935 9 | */ 10 | @XStreamAlias("Response") 11 | public class MediaInfoResponse extends CiServiceResult { 12 | /** 13 | * 媒体信息实体对象 14 | */ 15 | @XStreamAlias("MediaInfo") 16 | private MediaInfoStreamObject mediaInfo; 17 | 18 | public MediaInfoStreamObject getMediaInfo() { 19 | if (mediaInfo==null){ 20 | mediaInfo = new MediaInfoStreamObject(); 21 | } 22 | return mediaInfo; 23 | } 24 | 25 | public void setMediaInfo(MediaInfoStreamObject mediaInfo) { 26 | this.mediaInfo = mediaInfo; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "MediaInfoResponse{" + 32 | "mediaInfo=" + mediaInfo + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/qcloud/cos/endpoint/CIPicRegionEndpointBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.endpoint; 2 | 3 | import com.qcloud.cos.region.Region; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | 7 | import static org.junit.Assert.assertEquals; 8 | 9 | public class CIPicRegionEndpointBuilderTest { 10 | 11 | private Region mockRegion = new Region("ap-chongqing"); 12 | 13 | private CIPicRegionEndpointBuilder ciPicRegionEndpointBuilderUnderTest; 14 | 15 | @Before 16 | public void setUp() throws Exception { 17 | ciPicRegionEndpointBuilderUnderTest = new CIPicRegionEndpointBuilder(mockRegion); 18 | } 19 | 20 | @Test 21 | public void testBuildGeneralApiEndpoint() { 22 | assertEquals("test-123456789.pic.ap-chongqing.myqcloud.com", ciPicRegionEndpointBuilderUnderTest.buildGeneralApiEndpoint("test-123456789")); 23 | } 24 | 25 | @Test 26 | public void testBuildGetServiceApiEndpoint() { 27 | assertEquals("service.pic.myqcloud.com", ciPicRegionEndpointBuilderUnderTest.buildGetServiceApiEndpoint()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/ai/SucFaceRects.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.ai; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class SucFaceRects { 6 | @XStreamAlias("X") 7 | private Integer x; 8 | @XStreamAlias("Y") 9 | private Integer y; 10 | @XStreamAlias("Width") 11 | private Integer width; 12 | @XStreamAlias("Height") 13 | private Integer height; 14 | 15 | public Integer getX() { 16 | return x; 17 | } 18 | 19 | public void setX(Integer x) { 20 | this.x = x; 21 | } 22 | 23 | public Integer getY() { 24 | return y; 25 | } 26 | 27 | public void setY(Integer y) { 28 | this.y = y; 29 | } 30 | 31 | public Integer getWidth() { 32 | return width; 33 | } 34 | 35 | public void setWidth(Integer width) { 36 | this.width = width; 37 | } 38 | 39 | public Integer getHeight() { 40 | return height; 41 | } 42 | 43 | public void setHeight(Integer height) { 44 | this.height = height; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/BatchImageAuditingResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.qcloud.cos.model.CiServiceResult; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * 图片批量审核响应实体 参数详情参考:https://cloud.tencent.com/document/product/460/37318 10 | */ 11 | public class BatchImageAuditingResponse extends CiServiceResult { 12 | /** 13 | * 任务的详细信息 14 | */ 15 | private List jobList; 16 | 17 | public List getJobList() { 18 | if (jobList == null) { 19 | jobList = new ArrayList<>(); 20 | } 21 | return jobList; 22 | } 23 | 24 | public void setJobList(List jobsDetail) { 25 | this.jobList = jobsDetail; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | final StringBuffer sb = new StringBuffer("VideoAuditingResponse{"); 31 | sb.append("jobsDetail=").append(jobList); 32 | sb.append('}'); 33 | return sb.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/common/FileProcessInputObject.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.common; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class FileProcessInputObject extends MediaInputObject { 6 | @XStreamAlias("BucketId") 7 | private String bucketId; 8 | @XStreamAlias("Region") 9 | private String region; 10 | 11 | public String getBucketId() { 12 | return bucketId; 13 | } 14 | 15 | public void setBucketId(String bucketId) { 16 | this.bucketId = bucketId; 17 | } 18 | 19 | public String getRegion() { 20 | return region; 21 | } 22 | 23 | public void setRegion(String region) { 24 | this.region = region; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | final StringBuffer sb = new StringBuffer("FileProcessInputObject{"); 30 | sb.append("bucketId='").append(bucketId).append('\''); 31 | sb.append(", region='").append(region).append('\''); 32 | sb.append('}'); 33 | return sb.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/WordList.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | public class WordList { 6 | /** 7 | * 词级别文本 8 | */ 9 | @XStreamAlias("word") 10 | private String word; 11 | 12 | /** 13 | * 开始时间 14 | */ 15 | @XStreamAlias("start_time") 16 | private Integer start_time; 17 | 18 | /** 19 | * 结束时间 20 | */ 21 | @XStreamAlias("end_time") 22 | private Integer end_time; 23 | 24 | public String getWord() { 25 | return word; 26 | } 27 | 28 | public void setWord(String word) { 29 | this.word = word; 30 | } 31 | 32 | public Integer getStart_time() { 33 | return start_time; 34 | } 35 | 36 | public void setStart_time(Integer start_time) { 37 | this.start_time = start_time; 38 | } 39 | 40 | public Integer getEnd_time() { 41 | return end_time; 42 | } 43 | 44 | public void setEnd_time(Integer end_time) { 45 | this.end_time = end_time; 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/bucketcertificate/BucketDomainCertificateParameters.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.bucketcertificate; 2 | 3 | public class BucketDomainCertificateParameters { 4 | 5 | public static final String Element_Domain_Certificate = "DomainCertificate"; 6 | 7 | public static final String Element_Status = "Status"; 8 | 9 | public static final String Element_CertificateInfo = "CertificateInfo"; 10 | 11 | public static final String Element_CertType = "CertType"; 12 | 13 | public static final String Element_Cert = "Cert"; 14 | 15 | public static final String Element_PrivateKey = "PrivateKey"; 16 | 17 | public static final String Element_DomainList = "DomainList"; 18 | 19 | public static final String Element_DomainName = "DomainName"; 20 | 21 | public static final String Element_CustomCert = "CustomCert"; 22 | 23 | public static final String Custom_CertType = "CustomCert"; 24 | 25 | public static final String Parameter_Domain_Certificate = "domaincertificate"; 26 | 27 | public static final String Parameter_Domain_Name = "domainname"; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ListBucketsResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model; 2 | 3 | import java.util.List; 4 | 5 | public class ListBucketsResult { 6 | private List buckets; 7 | 8 | private boolean isTruncated; 9 | 10 | private String nextMarker; 11 | 12 | private Owner bucketOwner; 13 | 14 | public List getBuckets() { 15 | return buckets; 16 | } 17 | 18 | public void setBuckets(List buckets) { 19 | this.buckets = buckets; 20 | } 21 | 22 | public boolean isTruncated() { 23 | return isTruncated; 24 | } 25 | 26 | public void setTruncated(boolean truncated) { 27 | isTruncated = truncated; 28 | } 29 | 30 | public String getNextMarker() { 31 | return nextMarker; 32 | } 33 | 34 | public void setNextMarker(String nextMarker) { 35 | this.nextMarker = nextMarker; 36 | } 37 | 38 | public Owner getBucketOwner() { 39 | return bucketOwner; 40 | } 41 | 42 | public void setBucketOwner(Owner bucketOwner) { 43 | this.bucketOwner = bucketOwner; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingLiveOutput.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | import com.qcloud.cos.model.ciModel.job.MediaTranscodeObject; 4 | 5 | public class AuditingLiveOutput { 6 | private String url; 7 | private MediaTranscodeObject transcode; 8 | 9 | public String getUrl() { 10 | return url; 11 | } 12 | 13 | public void setUrl(String url) { 14 | this.url = url; 15 | } 16 | public MediaTranscodeObject getTranscode() { 17 | if (transcode == null) { 18 | transcode = new MediaTranscodeObject(); 19 | } 20 | return transcode; 21 | } 22 | 23 | public void setTranscode(MediaTranscodeObject transcode) { 24 | this.transcode = transcode; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | final StringBuilder sb = new StringBuilder("AuditingLiveOutput{"); 30 | sb.append("url='").append(url).append('\''); 31 | sb.append(", transcode=").append(transcode); 32 | sb.append('}'); 33 | return sb.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DescribeDatasetBindingRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | 12 | public class DescribeDatasetBindingRequest extends CIServiceRequest { 13 | 14 | /** 15 | *数据集名称,同一个账户下唯一。;是否必传:是 16 | */ 17 | private String datasetname; 18 | 19 | /** 20 | *资源标识字段,表示需要与数据集绑定的资源,当前仅支持COS存储桶,字段规则:cos://,其中BucketName表示COS存储桶名称,例如(需要进行urlencode):cos%3A%2F%2Fexample-125000;是否必传:是 21 | */ 22 | private String uri; 23 | 24 | public String getDatasetname() { return datasetname; } 25 | 26 | public void setDatasetname(String datasetname) { this.datasetname = datasetname; } 27 | 28 | public String getUri() { return uri; } 29 | 30 | public void setUri(String uri) { this.uri = uri; } 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/internal/converter/CIConverter.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.internal.converter; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.converters.Converter; 5 | import com.thoughtworks.xstream.converters.MarshallingContext; 6 | import com.thoughtworks.xstream.converters.UnmarshallingContext; 7 | import com.thoughtworks.xstream.io.HierarchicalStreamReader; 8 | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 9 | 10 | // 自定义转换器来处理null值字段 11 | public class CIConverter implements Converter { 12 | 13 | @Override 14 | public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { 15 | // 在此处检查字段是否为null,根据需要决定是否写入到XML中 16 | if (source instanceof CIServiceRequest) { 17 | 18 | } 19 | } 20 | 21 | @Override 22 | public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { 23 | return null; 24 | } 25 | 26 | @Override 27 | public boolean canConvert(Class type) { 28 | // 此处返回true,以便将该转换器应用于所有类型的对象 29 | return true; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/GetBucketAclRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | 15 | * According to cos feature, we modify some class,comment, field name, etc. 16 | */ 17 | 18 | 19 | package com.qcloud.cos.model; 20 | 21 | /** 22 | * Request object containing all the options for requesting a bucket's Access Control List (ACL). 23 | */ 24 | public class GetBucketAclRequest extends GenericBucketRequest { 25 | 26 | public GetBucketAclRequest(String bucketName) { 27 | super(bucketName); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/auditing/AuditingImage.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.auditing; 2 | 3 | public class AuditingImage { 4 | private String label; 5 | private String type; 6 | private String url; 7 | 8 | public String getLabel() { 9 | return label; 10 | } 11 | 12 | public void setLabel(String label) { 13 | this.label = label; 14 | } 15 | 16 | public String getType() { 17 | return type; 18 | } 19 | 20 | public void setType(String type) { 21 | this.type = type; 22 | } 23 | 24 | public String getUrl() { 25 | return url; 26 | } 27 | 28 | public void setUrl(String url) { 29 | this.url = url; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | final StringBuilder sb = new StringBuilder("AuditingImage{"); 35 | sb.append("label='").append(label).append('\''); 36 | sb.append(", type='").append(type).append('\''); 37 | sb.append(", url='").append(url).append('\''); 38 | sb.append('}'); 39 | return sb.toString(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/bucket/MediaBucketResponse.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.bucket; 2 | 3 | import com.qcloud.cos.model.ciModel.common.MediaCommonResponse; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * 数据万象 媒体bucket查询接口响应实体 详情见 https://cloud.tencent.com/document/product/460/38914 10 | */ 11 | public class MediaBucketResponse extends MediaCommonResponse { 12 | private List MediaBucketList; 13 | 14 | public MediaBucketResponse() { 15 | MediaBucketList = new ArrayList<>(); 16 | } 17 | 18 | public List getMediaBucketList() { 19 | return MediaBucketList; 20 | } 21 | 22 | public void setMediaBucketList(List mediaBucketList) { 23 | MediaBucketList = mediaBucketList; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | final StringBuffer sb = new StringBuffer("MediaBucketResponse{"); 29 | sb.append("MediaBucketList=").append(MediaBucketList); 30 | sb.append('}'); 31 | return sb.toString(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/DeleteFileMetaIndexRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.qcloud.cos.internal.CIServiceRequest; 5 | import com.thoughtworks.xstream.annotations.XStreamAlias; 6 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 7 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | 13 | public class DeleteFileMetaIndexRequest extends CIServiceRequest { 14 | 15 | /** 16 | *数据集名称,同一个账户下唯一。;是否必传:是 17 | */ 18 | private String datasetName; 19 | 20 | /** 21 | *资源标识字段,表示需要建立索引的文件地址。;是否必传:是 22 | */ 23 | @JsonProperty("URI") 24 | private String uRI; 25 | 26 | public String getDatasetName() { return datasetName; } 27 | 28 | public void setDatasetName(String datasetName) { this.datasetName = datasetName; } 29 | 30 | public String getURI() { return uRI; } 31 | 32 | public void setURI(String uRI) { this.uRI = uRI; } 33 | 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 腾讯云 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/job/v2/DNAResult.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.job.v2; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 5 | 6 | import java.util.List; 7 | 8 | public class DNAResult { 9 | @XStreamImplicit(itemFieldName = "Detection") 10 | List detections; 11 | 12 | @XStreamAlias("VideoId") 13 | private String videoId; 14 | 15 | @XStreamAlias("Duration") 16 | private String duration; 17 | 18 | public List getDetections() { 19 | return detections; 20 | } 21 | 22 | public void setDetections(List detections) { 23 | this.detections = detections; 24 | } 25 | 26 | public String getVideoId() { 27 | return videoId; 28 | } 29 | 30 | public void setVideoId(String videoId) { 31 | this.videoId = videoId; 32 | } 33 | 34 | public String getDuration() { 35 | return duration; 36 | } 37 | 38 | public void setDuration(String duration) { 39 | this.duration = duration; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/qcloud/cos/model/ciModel/metaInsight/CreateFileMetaIndexRequest.java: -------------------------------------------------------------------------------- 1 | package com.qcloud.cos.model.ciModel.metaInsight; 2 | 3 | import com.qcloud.cos.internal.CIServiceRequest; 4 | import com.thoughtworks.xstream.annotations.XStreamAlias; 5 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 6 | import com.thoughtworks.xstream.annotations.XStreamOmitField; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | 12 | public class CreateFileMetaIndexRequest extends CIServiceRequest { 13 | 14 | /** 15 | *数据集名称,同一个账户下唯一。;是否必传:是 16 | */ 17 | private String datasetName; 18 | 19 | /** 20 | *用于建立索引的文件信息。;是否必传:是 21 | */ 22 | private File file; 23 | 24 | public String getDatasetName() { return datasetName; } 25 | 26 | public void setDatasetName(String datasetName) { this.datasetName = datasetName; } 27 | 28 | public File getFile() { 29 | if(file == null){ 30 | file = new File(); 31 | } 32 | return file; 33 | } 34 | 35 | public void setFile(File file) { this.file = file; } 36 | 37 | 38 | 39 | 40 | } 41 | --------------------------------------------------------------------------------