title: java.lang.NumberFormatException: For input string: " "
body: <pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: "    " 
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  at java.lang.Long.parseLong(Long.java:430)
  at java.lang.Long.valueOf(Long.java:540)
  at PckUtiles.lexec.leer(lexec.java:62)
  at PckUtiles.lexec.verificar(lexec.java:34)
  at PckjForms.Main.main(Main.java:40)
  </code></pre>
  
  <p>*<em>I have next error when run project "Exception in thread "main" java.lang.NumberFormatException: For input string: "
  the function of my class is to avoid re-run the application. could help to locate the fault. thank you very much
  *</em></p>
  
  <p>here is my class lexec</p>
  
  <pre><code>public class lexec {
      private String ruta = System.getProperties().getProperty("user.dir");
      private File archivo = new File(ruta + "\\Sifme.tmp");
      private int contador = 20;
  
      public lexec(){};
  
      public boolean verificar(){
          if(archivo.exists()){
              long time = leer();
              long res = rTiempo(time);
              if(res&lt;contador){
                  JOptionPane.showMessageDialog(null, "La aplicación esta en ejecución");
                  System.exit(0);
                  return false;
              }else{
                  tarea_();
                  return true;
              }
          }else{
              sifme();
              tarea_();
              return true;
          }
      }
  
      public long leer(){
          String line = "0";
          BufferedReader br;
          try{
              br = new BufferedReader(new FileReader(archivo));
              while(br.ready()){
                  line = br.readLine();
              }
          }catch(IOException e){
              System.err.println(e.getMessage());
          }
          return Long.valueOf(line).longValue();
      }
      public void tarea_(){
          ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();
          ses.scheduleAtFixedRate(
                  new Runnable(){
                      @Override
                      public void run(){
                          sifme();
                      }
                  },1000,contador*1000,TimeUnit.MILLISECONDS);
      }
  
      public void sifme(){
          Date fecha = new Date();
          try{
              BufferedWriter bw = new BufferedWriter(new FileWriter(archivo));
              bw.write(String.valueOf(fecha.getTime()));
              bw.close();
          }catch(IOException e){
              System.out.println(e.getMessage());
          }
      }
      public long rTiempo(long tiempoN){
          Date fecha = new Date();
          long t1 = fecha.getTime();
          long tiempo = t1 - tiempoN;
          tiempo = tiempo/1000;
          return tiempo;
      }
      public void detruir_(){
          if(archivo.exists()){
              archivo.delete();
              System.exit(0);
          }
      }
  }
  </code></pre>