|
@@ -45,6 +45,35 @@ public class FileUtils {
|
|
|
return rootPath;
|
|
|
}
|
|
|
|
|
|
+ public String analysisJsonFile() {
|
|
|
+ ApplicationHome ah = new ApplicationHome(BackupUtils.class);
|
|
|
+ File file = ah.getSource();
|
|
|
+ String settingFilePath = file.getParentFile().toString() + FileUtils.FILE_SEPARATOR + "uploadSetting.json";
|
|
|
+ BufferedReader reader = null;
|
|
|
+ StringBuilder last = new StringBuilder();
|
|
|
+ InputStreamReader inputStreamReader;
|
|
|
+ try (FileInputStream fileInputStream = new FileInputStream(settingFilePath)) {
|
|
|
+ inputStreamReader = new InputStreamReader(fileInputStream, StandardCharsets.UTF_8);
|
|
|
+
|
|
|
+ reader = new BufferedReader(inputStreamReader);
|
|
|
+ String tempString;
|
|
|
+ while ((tempString = reader.readLine()) != null) {
|
|
|
+ last.append(tempString);
|
|
|
+ }
|
|
|
+ reader.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (reader != null) {
|
|
|
+ try {
|
|
|
+ reader.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return last.toString();
|
|
|
+ }
|
|
|
|
|
|
public static File getFileByBytes(byte[] bytes, String prefix, String suffix) {
|
|
|
BufferedOutputStream bos = null;
|