MCPcopy Create free account
hub / github.com/GCMiner/GCMiner / createJsonFile1

Method createJsonFile1

src/main/java/Preprocess/Map2Json.java:77–102  ·  view source on GitHub ↗
(String jsonString, String filePath, String fileName)

Source from the content-addressed store, hash-verified

75 }
76
77 public static boolean createJsonFile1(String jsonString, String filePath, String fileName) {
78 boolean flag = true;
79
80 Map2Json map2Json = new Map2Json();
81
82
83 String fullPath = filePath + File.separator + fileName + ".json";
84
85
86 try{
87 File file = new File(fullPath);
88 if(!file.exists());
89 file.createNewFile();
90
91 Writer write = new OutputStreamWriter(new FileOutputStream(file),"UTF-8");
92 write.write(jsonString);
93
94 write.flush();
95 write.close();
96
97 }catch (Exception e){
98 flag = false;
99 e.printStackTrace();
100 }
101 return flag;
102 }
103}

Callers 1

testMethod · 0.95

Calls

no outgoing calls

Tested by 1

testMethod · 0.76