code: public static SimpleFeatureSource readFeatureSource( String path ) throws Exception {
          File shapeFile = new File(path);
          FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
          SimpleFeatureSource featureSource = store.getFeatureSource();
          return featureSource;
      }
docs: Get the feature source from a file.
  
  @param path
  the path to the shapefile.
  @return the feature source.
  @throws Exception