4242 */
4343public class PegdownWebSequencelPlugin extends Parser implements BlockPluginParser {
4444
45+ private static final String URL_WEBSEQUENCE = "http://www.websequencediagrams.com" ;
46+
4547 public PegdownWebSequencelPlugin () {
4648 super (PegdownParser .OPTIONS ,
4749 PegdownParser .PARSING_TIMEOUT_AS_MILLIS ,
4850 DefaultParseRunnerProvider );
4951 }
5052
51- public PegdownWebSequencelPlugin (Integer options ,
52- Long maxParsingTimeInMillis ,
53- ParseRunnerProvider parseRunnerProvider ,
53+ public PegdownWebSequencelPlugin (Integer options , Long millis , ParseRunnerProvider provider ,
5454 PegDownPlugins plugins ) {
55- super (options , maxParsingTimeInMillis , parseRunnerProvider , plugins );
55+ super (options , millis , provider , plugins );
5656 }
5757
5858 public static final String TAG = "%%%" ;
@@ -86,14 +86,15 @@ Rule block() {
8686 new TextNode ("" ))));
8787 }
8888
89- public static String createWebsequenceUrl (String style ,
90- String content ) {
89+ public static String createWebsequenceUrl (String style , String content ) {
9190
9291 style = StringUtils .defaultString (style , "default" );
9392
9493 OutputStreamWriter writer = null ;
9594 BufferedReader reader = null ;
9695
96+ String apiUrl = "" ;
97+
9798 try {
9899 String query = new StringBuilder ()
99100 .append ("style=" )
@@ -103,7 +104,7 @@ public static String createWebsequenceUrl(String style,
103104 .append ("&apiVersion=1" )
104105 .toString ();
105106
106- URL url = new URL ("http://www.websequencediagrams.com" );
107+ URL url = new URL (URL_WEBSEQUENCE );
107108 URLConnection conn = url .openConnection ();
108109 conn .setDoOutput (true );
109110 writer = new OutputStreamWriter (conn .getOutputStream (), StandardCharsets .UTF_8 );
@@ -128,16 +129,16 @@ public static String createWebsequenceUrl(String style,
128129 int end = json .indexOf ("\" " , start );
129130
130131 if (start != -1 && end != -1 ) {
131- return "http://www.websequencediagrams.com /" + json .substring (start , end );
132+ apiUrl = URL_WEBSEQUENCE + " /" + json .substring (start , end );
132133 }
133134 } catch (IOException e ) {
134- throw new RuntimeException ("Failed to get proper response from websequencediagrams.com" );
135+ throw new RuntimeException ("Failed to get proper response from websequencediagrams.com" , e );
135136 } finally {
136137 IOUtils .closeQuietly (writer );
137138 IOUtils .closeQuietly (reader );
138139 }
139140
140- return "" ;
141+ return apiUrl ;
141142 }
142143
143144 @ Override
0 commit comments