public static TrashPolicy getInstance ( Configuration conf , FileSystem fs , Path home ) throws IOException { Class < ? extends TrashPolicy > trashClass = conf . getClass ( "fs.trash.classname" , TrashPolicyDefault . class , TrashPolicy . class ) ; TrashPolicy trash = ( TrashPolicy ) ReflectionUtils . newInstance ( trashClass , conf ) ; trash . initialize ( conf , fs , home ) ; // initialize TrashPolicy return trash ; }
Get an instance of the configured TrashPolicy based on the value of the configuration paramater fs . trash . classname .