-2

I am trying to connect to Astra DB which requires a path to secure-connect zip.

This line is causing the issue:

.withCloudSecureConnectBundle(Paths.get("E:\\ProjectAndroid\\9_14_2022_2\\RentPK\\app\\src\\main\\res\\secure-connect-rentpk"))

Path.get gives the error.

I wanted to connect Astra DB using secure-connect zip but Paths.get() not working for the given path. Where the path is: E:\\ProjectAndroid\\9_14_2022_2\\RentPK\\app\\src\\main\\res\\secure-connect-rentpk

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Uzzam Altaf
  • 303
  • 4
  • 8
  • Can you list that directory and show us the result so we can see that the file really exists there? – markspace Oct 27 '22 at 21:18
  • 3
    You tagged this as [tag:android-studio] (which should almost certainly be [tag:android], since this question doesn't seem IDE specific). If this is supposed to run on Android, then that path will not work, because `E:\ProjectAndroid\...` is obviously a Window path and doesn't exist on Android. – Joachim Sauer Oct 27 '22 at 21:31

1 Answers1

0

It looks like you haven't provided the full name for the secure bundle. In your sample code, you've specified the filename as secure-connect-rentpk which is incorrect.

You need to make sure that you include the .zip suffix in the filename and don't unzip the bundle leaving it intact. For example:

    .withCloudSecureConnectBundle(Paths.get("/path/to/secure-connect-db.zip"))

As a side note, you should never include the secure bundle in your source code. You need to place it in a separate location such as a configuration folder for best practice. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23