for (File dir : directoryList) {
String path = dir.getPath();
String dirName = dir.getName();
double scale = getScale(dirName);
Grid grid = new Grid();
grid.setParameters(parameters);
grid.setScale(scale);
grid.setSubEnvelop(getEnvelop(0, 0, scale));
setTile4Grid(grid, path);
grid.setGridData(gridData);
grids[i] = grid;
i++;
}
layer.setGrids(grids);