Here you can find the source of resolveMaxStep(String rootPath)
public static int resolveMaxStep(String rootPath)
//package com.java2s; //License from project: Apache License import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class Main { public static int resolveMaxStep(String rootPath) { int maxStep = 0; while (Files.exists(Paths.get(rootPath + File.separator + String.valueOf(maxStep + 1)))) { maxStep++;//from w w w . ja v a2 s .c o m } return maxStep; } }