A 58-year-old janitor who authorities say was obsessed with a woman at his western New York workplace has been sentenced to 25 years to life in prison for trying to abduct and kill her.