code: public static void renameTileSet (
          String mapPath, String oldName, String newName)
          throws PersistenceException
      {
          MapFileTileSetIDBroker broker =
              new MapFileTileSetIDBroker(new File(mapPath));
          if (!broker.renameTileSet(oldName, newName)) {
              throw new PersistenceException(
                  "No such old tileset '" + oldName + "'.");
          }
          broker.commit();
      }
docs: Loads up the tileset map file with the specified path and copies
  the tileset ID from the old tileset name to the new tileset name.
  This is necessary when a tileset is renamed so that the new name
  does not cause the tileset to be assigned a new tileset ID. Bear in
  mind that the old name should never again be used as it will
  conflict with a tileset provided under the new name.