@@ -28,6 +28,8 @@ public class TileDBClient{
28
28
29
29
private static final String homeDir = System .getProperty ("user.home" );
30
30
31
+ private static String cloudFilePath ;
32
+
31
33
static Logger logger = Logger .getLogger (TileDBClient .class .getName ());
32
34
33
35
private ApiClient apiClient ;
@@ -42,6 +44,14 @@ public class TileDBClient{
42
44
password = "" ;
43
45
basePath = "https://api.tiledb.com/v1" ;
44
46
loginInfoIsInJSONFile = true ;
47
+
48
+ // set path according to OS
49
+ if (System .getProperty ("os.name" ).toLowerCase ().contains ("windows" )){
50
+ cloudFilePath = "\\ .tiledb\\ cloud.json" ;
51
+ } else {
52
+ cloudFilePath = "/.tiledb/cloud.json" ;
53
+ }
54
+
45
55
boolean ok = false ;
46
56
try {
47
57
ok = loadCloudJSONFileFromHome ();
@@ -60,7 +70,7 @@ public class TileDBClient{
60
70
* @throws IOException
61
71
*/
62
72
private static boolean loadCloudJSONFileFromHome () throws IOException {
63
- String fileName = homeDir + "/.tiledb/cloud.json" ;
73
+ String fileName = homeDir + cloudFilePath ;
64
74
65
75
File initialFile = new File (fileName );
66
76
InputStream is = Files .newInputStream (initialFile .toPath ());
@@ -148,7 +158,7 @@ private void writeAuthJSONFileToHome() {
148
158
jsonObject .put ("host" , "https://api.tiledb.com" );
149
159
jsonObject .put ("verify_ssl" , verifyingSsl );
150
160
try {
151
- File file = new File (homeDir + "/.tiledb/cloud.json" );
161
+ File file = new File (homeDir + cloudFilePath );
152
162
file .getParentFile ().mkdirs (); //create /.tiledb dir if not present
153
163
FileWriter fileWriter = new FileWriter (file );
154
164
fileWriter .write (jsonObject .toString ());
0 commit comments