package graphTool;

import java.io.*;
import javax.swing.*;

public class LogUtilities
{
   private LogUtilities() {}

   public static File[] loadFile()
   {
      JFileChooser fc_open = new JFileChooser();
      fc_open.setMultiSelectionEnabled(true);
      
      int choice = fc_open.showOpenDialog(null);
      if(choice == JFileChooser.APPROVE_OPTION)
      {
         File[] files = fc_open.getSelectedFiles();
         
         for(int i = 0; i < files.length; ++i)
         {
            if(!files[i].exists() || !files[i].getName().endsWith("tcra_log"))
            {
               return null;
            } // end if
         } // end for
         
         return files;
      } // end if
      
      return null;
   } // end loadFile()
} // end class
