title: How to upload a file to OCI Object storage
body: <p>I am trying to use <code>UploadObjectExample.java</code> code to upload a file to OCI object storage. I am running into connection timeout error while connecting to the object storage URL. The same config file is used by OCI CLI to successfully upload files to OCI config. </p>
  
  <p>Here is the Error log:</p>
  
  <pre><code>Exception in thread "main" com.oracle.bmc.model.BmcException: (-1, null, true) Timed out while communicating to: https://objectstorage.us-ashburn-1.oraclecloud.com (outbound opc-request-id: 1EB5AA4A7FD64D58A54F876AD0C9E83B)
      at com.oracle.bmc.http.internal.RestClient.convertToBmcException(RestClient.java:572)
      at com.oracle.bmc.http.internal.RestClient.put(RestClient.java:380)
      at com.oracle.bmc.objectstorage.ObjectStorageClient.putObject(ObjectStorageClient.java:1053)
      at com.oracle.bmc.objectstorage.transfer.internal.SimpleRetry$1.apply(SimpleRetry.java:34)
      at com.oracle.bmc.objectstorage.transfer.internal.SimpleRetry$1.apply(SimpleRetry.java:26)
      at com.oracle.bmc.objectstorage.transfer.UploadManager.singleUpload(UploadManager.java:111)
      at com.oracle.bmc.objectstorage.transfer.UploadManager.upload(UploadManager.java:73)
      at UploadObjectExample.main(UploadObjectExample.java:74)
  Caused by: javax.ws.rs.ProcessingException: java.net.SocketTimeoutException: connect timed out
      at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:284)
      at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)
      at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:753)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)
      at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:752)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:445)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.put(JerseyInvocation.java:334)
      at com.oracle.bmc.http.internal.ForwardingInvocationBuilder.put(ForwardingInvocationBuilder.java:141)
      at com.oracle.bmc.http.internal.RestClient.put(RestClient.java:377)
  </code></pre>