Code example for FileNotFoundException

0
      if (weightsFile.get() != null) { 
        FileSystem fs = FileSystem.get(weightsFile.get().toUri(), jobConf); 
        VectorWritable weights = 
            ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); 
        if (!fs.exists(weightsFile.get())) { 
          throw new FileNotFoundException(weightsFile.get().toString()); 
        } 
        DataInputStream in = fs.open(weightsFile.get()); 
        try { 
          weights.readFields(in); 
        } finally { 
          Closeables.close(in, true); 
        } 
        this.weights = weights.get(); 
      } 
    } catch (IOException e) { 
      throw new IllegalStateException(e); 
    } 
  }