When Donald J. Trump returned to the criminal courthouse at 100 Centre Street last week, a familiar feature of the New York City streetscape was there to greet him: a steel-and-plywood parapet the color of a fake Christmas tree, propped over the sidewalk.

How long the protective barrier will remain up is anybody’s guess, but it surely will outlast the former president’s trial. And his current campaign for re-election. And, possibly, his second term, should he win in November.

In New York City, politicians come and go. But the sidewalk shed abides.

There are more than 8,500 sidewalk sheds along the city’s streets, according to records maintained by the Buildings Department. End to end, they would stretch from Manhattan to Montreal.

They are meant to be temporary, erected to shield pedestrians from falling debris while buildings are being constructed, inspected or repaired. But nearly 1,000 of the sheds have been in place for more than three years, city records show, enduring eyesores that can overshadow whole blocks. One shed on the Grand Concourse in the Bronx and another in the Wingate section of Brooklyn have stood since 2011, records show.

At many of those sites, no work is being done. The property owners put the sheds up to comply with local laws that some consider draconian and found that keeping them in place was less expensive than fixing their facades.