Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
How to download a video file from amazon s3 to specific folder using Java

I am trying to download a video file from S3 account.It is niether giving me an error nor I am able to see the file downloaded means I am not getting the location of file.I have a doubt that is my file is getting downloaded.Pls give a solution on this.Thanks in advance here is my code:

System.out.println("Downloading an object");
        S3Object object = s3.getObject(new GetObjectRequest(bucketName, key));
        System.out.println("Content-Type: "  + object.getObjectMetadata().getContentType());
         object.getObjectContent();
    }catch(AmazonServiceException ex){
        System.out.println("Caught an AmazonServiceException, which means your request made it "
                + "to Amazon S3, but was rejected with an error response for some reason.");
        System.out.println("Error Message:    " + ex.getMessage());
        System.out.println("HTTP Status Code: " + ex.getStatusCode());
        System.out.println("AWS Error Code:   " + ex.getErrorCode());
        System.out.println("Error Type:       " + ex.getErrorType());
        System.out.println("Request ID:       " + ex.getRequestId());
    }catch (AmazonClientException ace) {
        System.out.println("Caught an AmazonClientException, which means the client encountered "
                + "a serious internal problem while trying to communicate with S3, "
                + "such as not being able to access the network.");
        System.out.println("Error Message: " + ace.getMessage());
    }
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

object.getObjectContent() gives the stream of data from the HTTP connection, is there any exception reading from the stream? you can also try s3.getObjectAsString()

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda