public ReadFile(String path) throws java.util.regex.PatternSyntaxException
    {
        try
        {
              FileInputStream fstream = new FileInputStream(path);
              // Get the object of DataInputStream
              DataInputStream in = new DataInputStream(fstream);
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String s="";                          
              //now read the file              
              while((s=br.readLine())!=null)
              {
                  //System.out.println(s);
                  if(s.contains("Coordinate "))
                  {
                      //System.out.println(s);
                      
                      //next line onwards i get points
                      String a=br.readLine();
                      //System.out.println(a);
                      if(a!=null)
                      {
                          a=a.trim();
                          //System.out.println(a);
                          String t1[]=a.split(" ");
                          //t1[2]=t1[2].trim();
                          //System.out.println(t1[5]);  // the character are 3,4,5 :)
                          float x,y,z;
                          x=Float.parseFloat(t1[3]);
                          y=Float.parseFloat(t1[4]);
                          String t2[]=t1[5].split(",");
                          z=Float.parseFloat(t2[0]);
                          //System.out.println(x+" "+y+" "+z);
                          Point p = new Point(x,y,z);
                          list.add(p);
                          //break;
                      }
                      while((a=br.readLine())!=null)
                      {
                          a=a.trim();
                          String t1[]=a.split(" ");
                          //t1[2]=t1[2].trim();
                          //System.out.println(t1[5]);  // the character are 3,4,5 :)
                          float x,y,z;
                          x=Float.parseFloat(t1[0]);
                          y=Float.parseFloat(t1[1]);
                          String t2[]=t1[2].split(",");
                          z=Float.parseFloat(t2[0]);
                         // System.out.println(x+" "+y+" "+z);
                          Point p = new Point(x,y,z);
                          list.add(p);
                          
                          if(a.contains("]"))
                          {
                              break;
                          }
                      }
                      
                  }
                  
                  
                  if(s.contains("coordIndex"))
                  {
                      //System.out.println(s);
                      
                      //next line onwards i get points
                      String a=s;
                      //System.out.println(a);
                      if(a!=null)
                      {
                          a=a.trim();
                          //System.out.println(a);
                          String t[]=a.split(",");
                          //int a1=Integer.parseInt(t[0].trim());
                          int a2=Integer.parseInt(t[1].trim());
                          int a3=Integer.parseInt(t[2].trim());
                          
                          
                          String t1[]=t[0].split(" ");
                         // System.out.println(t1[1]);
                          char a11=t1[1].charAt(1);
                          String c=""+a11;
                          int a1=Integer.parseInt(c.trim());
                          //System.out.println(a1+" "+a2+" "+a3);
                          
                         Point p1 = (Point) list.get(a1); 
                          Point p2 = (Point) list.get(a2); 
                          Point p3 = (Point) list.get(a3); 
                          
                          //System.out.println(p1.x+" "+p1.y+" "+p1.z);
                          Edge e1 = new Edge(p1,p2);
                          edges.add(e1);
                          Edge e2 = new Edge(p2,p3);
                          edges.add(e2);
                          //break;
                      }
                      while((a=br.readLine())!=null)
                      {
                          a=a.trim();
                          //System.out.println(a);
                          String t[]=a.split(",");
                          int a1=Integer.parseInt(t[0].trim());
                          int a2=Integer.parseInt(t[1].trim());
                          int a3=Integer.parseInt(t[2].trim());
                          
                          
                          
                          //System.out.println(a1+" "+a2+" "+a3);
                          
                         Point p1 = (Point) list.get(a1); 
                          Point p2 = (Point) list.get(a2); 
                          Point p3 = (Point) list.get(a3); 
                          
                          
                          boolean flag;
                          flag=p1.check(p2);
                          
                          if(flag==false)
                          {
                              Edge e1 = new Edge(p1,p2);
                              p1.addedge(e1);
                              p2.addedge(e1);
                              edges.add(e1);
                          }
                          
                          
                          flag=p2.check(p3);
                          
                          if(flag==false)
                          {
                              Edge e1 = new Edge(p2,p3);
                              p3.addedge(e1);
                              p2.addedge(e1);
                              edges.add(e1);
                          }
                          //Edge e1 = new Edge(p1,p2);
                          
                          //p1.connector.contains(t);
                          
                          //edges.add(e1);
                          //boolean flag=true;
                          //edges.contains(p1,p2);
                          //p1.addedge(e1);
                          //p2.addedge(e1);
                          
                          if(a.contains("]"))
                          {
                              //System.out.println(a);
                              break;
                          }
                      }
                      break;
                  }
              }      
        }
        catch(Exception e)
        {
            System.out.println(e);
        }        
    }