public class S3Util extends Object
Constructor and Description |
---|
S3Util() |
Modifier and Type | Method and Description |
---|---|
static List<DomainControllerData> |
domainControllerDataFromByteBuffer(byte[] buffer)
Get the domain controller data from the given byte buffer.
|
static byte[] |
domainControllerDataToByteBuffer(List<DomainControllerData> data)
Write the domain controller data to a byte buffer.
|
static String |
generatePreSignedUrl(String awsAccessKey,
String awsSecretAccessKey,
String method,
String bucket,
String key,
long expirationDate)
Use this helper method to generate pre-signed S3 urls.
|
static String |
readString(DataInput in) |
protected static String |
sanitize(String name)
Sanitize bucket and folder names according to AWS guidelines.
|
static void |
writeString(String s,
DataOutput out) |
public static List<DomainControllerData> domainControllerDataFromByteBuffer(byte[] buffer) throws Exception
buffer
- the byte bufferException
public static byte[] domainControllerDataToByteBuffer(List<DomainControllerData> data) throws Exception
data
- the domain controller dataException
protected static String sanitize(String name)
public static String generatePreSignedUrl(String awsAccessKey, String awsSecretAccessKey, String method, String bucket, String key, long expirationDate)
awsAccessKey
- Your AWS Access KeyawsSecretAccessKey
- Your AWS Secret Access Keymethod
- The HTTP method - use "put" or "delete" for use with S3_PINGbucket
- The S3 bucket you want to write tokey
- The key within the bucket to write toexpirationDate
- The date this pre-signed url should expire, in seconds since epochpublic static void writeString(String s, DataOutput out) throws Exception
Exception
Copyright © 2023 JBoss by Red Hat. All rights reserved.