Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
How to Change Amazon S3 file URL Like s3.amazonaws.com/bucket/key from bucket.s3.amazonaws.com/key in Java?

Working with AmazonS3 bucket - After uploading file to bucket, we can get uploaded file URL using below code :

String fileDownloadUrl = AmzonS3Client.getUrl(bucketName, fileName);

In Result it will give url like i.e : bucket.s3.amazonaws.com/key but I want s3.amazonaws.com/bucket/key. So Can anyone help me how can I solve this in java?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

By default pathstyleaccess is false so your uploaded file should be bucket.s3.amazonaws.com/key but when you explicitly add clientOptions -- pathStyleAccess to true then it will generate URL like s3.amazonaws.com/bucket/key. Please find below code snippet

S3ClientOptions clientOptions = new S3ClientOptions(); clientOptions.setPathStyleAccess(true);

And set this clientOptions to Amazons3client.

about 4 years ago · Santiago Trujillo Relatório

0

Another Solution:

Create AmazonS3Client object using AmazonS3ClientBuilder with enablePathStyleAccess().

AmazonS3 client = AmazonS3ClientBuilder.standard()
        .enablePathStyleAccess()
        .withRegion(regionName)
        .withCredentials(new AWSStaticCredentialsProvider(credentials))
        .build();
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda