当前位置:   article > 正文

java导出sas_[Azure Storage]使用Java上传文件到Storage并生成SAS签名

共享签名url sas连接blob并且上传文件 java

1 importjava.io.ByteArrayInputStream;2 importjava.io.File;3 importjava.io.FileInputStream;4 importjava.io.FileNotFoundException;5 importjava.io.IOException;6 importjava.net.URISyntaxException;7 importjava.security.InvalidKeyException;8 importjava.security.KeyManagementException;9 importjava.security.NoSuchAlgorithmException;10 importjava.security.SecureRandom;11 importjava.security.cert.X509Certificate;12 importjava.util.ArrayList;13 importjava.util.Calendar;14 importjava.util.Date;15 importjava.util.EnumSet;16 importjava.util.GregorianCalendar;17 importjava.util.Random;18 importjava.util.TimeZone;19

20 import javax.net.ssl.*;21

22 importcom.microsoft.azure.storage.CloudStorageAccount;23 importcom.microsoft.azure.storage.StorageCredentials;24 importcom.microsoft.azure.storage.StorageCredentialsAccountAndKey;25 importcom.microsoft.azure.storage.StorageException;26 importcom.microsoft.azure.storage.blob.BlobContainerPermissions;27 importcom.microsoft.azure.storage.blob.BlobContainerPublicAccessType;28 importcom.microsoft.azure.storage.blob.BlockEntry;29 importcom.microsoft.azure.storage.blob.BlockSearchMode;30 importcom.microsoft.azure.storage.blob.CloudBlobClient;31 importcom.microsoft.azure.storage.blob.CloudBlobContainer;32 importcom.microsoft.azure.storage.blob.CloudBlockBlob;33 importcom.microsoft.azure.storage.blob.SharedAccessBlobPermissions;34 importcom.microsoft.azure.storage.blob.SharedAccessBlobPolicy;35

36

37 public classJavaStorageClient {38

39 static final String storageAccountName = "";40 static final String storageAccountKey = "";41 static final String containerName = "";42 static final String videoPath = "<>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/284402
推荐阅读
相关标签
  

闽ICP备14008679号