From the course: AWS for Developers: S3
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Binary object manipulation - Amazon Web Services (AWS) Tutorial
From the course: AWS for Developers: S3
Binary object manipulation
- [Instructor] So now it's time to work with some individual files using the Java SDK for S3. I think that you'll see that once again, we follow the same pattern over and over that we did with the createBucket. So let's start off here by creating some methods, so public void. First thing we want to do is upload a file, so we need to send in a bucket, a localFile, a localDirectory, and a key, and we'll do a try once again, but this time we're going to use the PutObjectRequest, which once again, has a builder. To that builder, we will add our bucket, we will add our key, now we'll call it s3.putObject, we will pass in our request. Okay, now we're going to use the paths from java.nio.file, and we're going to use the get, and we're going to pass it the local directory, and then the local file, and it will assemble that directory for us. Now we once again catch Exception, and much like I did before, I'm going to copy…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Java: Basic setup4m 15s
-
(Locked)
Creating a bucket4m 45s
-
(Locked)
Binary object manipulation4m 38s
-
(Locked)
Bucket manipulation4m 37s
-
(Locked)
Bucket and file security2m 59s
-
(Locked)
Presigning URLs4m 40s
-
(Locked)
Deleting a bucket1m 58s
-
(Locked)
Challenge: Java SDK operations50s
-
(Locked)
Solution: Java SDK operations2m 15s
-
(Locked)
-