String (String[] strings, int headLimit, int tailLimit) { if (strings.length <= headLimit + tailLimit) return null; StringBuilder buffer = new StringBuilder(); String separator = ""; for (int i = headLimit; i < strings.length - tailLimit; i++) { buffer.append(separator); buffer.append(strings[i]); separator = File.separator; } return buffer.toString(); }