Here you can find the source of removeAlreadyParsedFolders(ArrayList
public static ArrayList<String> removeAlreadyParsedFolders(ArrayList<String> listStrings, String pickup, String limit)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static ArrayList<String> removeAlreadyParsedFolders(ArrayList<String> listStrings, String pickup, String limit) {/*from ww w .ja v a 2 s . co m*/ int i; ArrayList<String> newList = listStrings; if (!pickup.isEmpty()) { for (i = 0; i < listStrings.size(); i++) if (listStrings.get(i).contains(pickup)) { newList = new ArrayList<>(listStrings.subList(i, listStrings.size())); break; } } if (!limit.isEmpty()) { for (i = 0; i < newList.size(); i++) if (newList.get(i).contains(limit)) { newList = new ArrayList<>(newList.subList(0, i)); break; } } return newList; } }