Is it possible to convert the OSM file to shapefile with GeoTools in Java?
No, geotools concentrates on standards based geographical data. Openstreetmap decided to invent their own incompatible format. Therefore you must use a tool written specifically for openstreetmap to convert to an interoperable format before geotools can help. You might be able to use a java library that can read openstreetmap data to write a geotools datastore but no one has bothered to yet.