Here you can find the source of parsePathToStack(String path)
public static Queue<String> parsePathToStack(String path)
//package com.java2s; //License from project: Apache License import java.util.LinkedList; import java.util.Queue; public class Main { public static Queue<String> parsePathToStack(String path) { Queue<String> queue = new LinkedList<>(); String[] pathParts = path.split("/"); if (pathParts != null && pathParts.length > 0) { for (String part : pathParts) { if (part.length() > 0) { queue.add(part);/* w w w. ja va2 s. c o m*/ } } } return queue; } }