PermanentRedirect error while uploading to S3 bucket with aws-sdk-java
<p>I am trying to upload a file from a java class to aws S3.</p>

<p>I am using the exact code  as given   <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpJava.html" rel="nofollow">here</a></p>

<p>The only parts I changed are these:</p>

<pre><code>private static String bucketName     = "s3-us-west-2.amazonaws.com/&lt;my-bubket-name&gt;";
private static String keyName        = "*** Provide key ***";
private static String uploadFileName = "/home/...&lt;localpath&gt;.../test123";
</code></pre>

<p>I am not sure what to add in <em>Provide Key</em> . But even if I leave it this way, i get an error like this :</p>

<blockquote>
  <p>Error Message:    The bucket is in this region: null.Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect; Request ID: *******)
  HTTP Status Code: 301
  AWS Error Code:   PermanentRedirect
  Error Type:       Client</p>
</blockquote>