@@ -715,51 +715,51 @@ private void setPrivateType() throws IOException {
715715 }
716716
717717 private void fromProcedureLog (String logFile , boolean withMarker , boolean withEnd ) throws IOException {
718- String lastLine = FileUtils . lastLineOfFile ( logFile );
719- if ( lastLine != null && ! "" . equals ( lastLine )) {
720- try {
718+ try {
719+ String lastLine = FileUtils . lastLineOfFile ( logFile );
720+ if ( lastLine != null && ! "" . equals ( lastLine )) {
721721 parseConfigMapFromJson (JsonUtils .toJsonObject (lastLine ), withMarker , withEnd );
722- } catch (Exception e ) {
723- File file = new File (logFile );
724- FileReader fileReader = new FileReader (file );
725- BufferedReader bufferedReader = new BufferedReader (fileReader );
726- int index ;
727- String line ;
728- String value ;
729- Map <String , String > map = new HashMap <>();
730- while ((line = bufferedReader .readLine ()) != null ) {
731- index = line .indexOf ("-|-" );
732- if (index < 0 ) {
733- try {
734- parseConfigMapFromJson (JsonUtils .toJsonObject (line ), withMarker , withEnd );
735- return ;
736- } catch (Exception exception ) {
737- exception .printStackTrace ();
738- }
739- } else {
740- map .put (line .substring (0 , index ), line .substring (index ));
722+ }
723+ } catch (Exception e ) {
724+ File file = new File (logFile );
725+ FileReader fileReader = new FileReader (file );
726+ BufferedReader bufferedReader = new BufferedReader (fileReader );
727+ int index ;
728+ String line ;
729+ String value ;
730+ Map <String , String > map = new HashMap <>();
731+ while ((line = bufferedReader .readLine ()) != null ) {
732+ index = line .indexOf ("-|-" );
733+ if (index < 0 ) {
734+ try {
735+ parseConfigMapFromJson (JsonUtils .toJsonObject (line ), withMarker , withEnd );
736+ return ;
737+ } catch (Exception exception ) {
738+ exception .printStackTrace ();
741739 }
740+ } else {
741+ map .put (line .substring (0 , index ), line .substring (index + 3 ));
742742 }
743- Map <String , String > configMap ;
744- for (String key : map .keySet ()) {
745- value = map .get (key );
746- if (!"" .equals (value )) {
747- try {
748- configMap = JsonUtils .fromJson (value , map .getClass ());
749- } catch (Exception e1 ) {
750- e1 .printStackTrace ();
751- continue ;
752- }
753- pathConfigMap .put (key , configMap );
743+ }
744+ Map <String , String > configMap ;
745+ for (String key : map .keySet ()) {
746+ value = map .get (key );
747+ if (!"" .equals (value )) {
748+ try {
749+ configMap = JsonUtils .fromJson (value , map .getClass ());
750+ } catch (Exception e1 ) {
751+ e1 .printStackTrace ();
752+ continue ;
754753 }
754+ pathConfigMap .put (key , configMap );
755755 }
756- try {
757- bufferedReader . close ();
758- fileReader .close ();
759- } catch ( IOException ioe ) {
760- bufferedReader = null ;
761- fileReader = null ;
762- }
756+ }
757+ try {
758+ bufferedReader .close ();
759+ fileReader . close ();
760+ } catch ( IOException ioe ) {
761+ bufferedReader = null ;
762+ fileReader = null ;
763763 }
764764 }
765765 }
@@ -1489,6 +1489,10 @@ public void setBucket(String bucket) {
14891489 this .bucket = bucket ;
14901490 }
14911491
1492+ public void setLogFilepath (String logFilepath ) {
1493+ this .logFilepath = logFilepath ;
1494+ }
1495+
14921496 public void setPathConfigMap (Map <String , Map <String , String >> pathConfigMap ) {
14931497 this .pathConfigMap = pathConfigMap ;
14941498 }
@@ -1689,6 +1693,10 @@ public String getBucket() {
16891693 return bucket ;
16901694 }
16911695
1696+ public String getLogFilepath () {
1697+ return logFilepath ;
1698+ }
1699+
16921700 public Map <String , Map <String , String >> getPathConfigMap () {
16931701 return pathConfigMap ;
16941702 }
0 commit comments