String (PackagingElement element, int level) { StringBuilder builder = new StringBuilder(StringUtil.repeatSymbol(' ', level)); if (element instanceof ArchivePackagingElement) { builder.append(((ArchivePackagingElement)element).getArchiveFileName()); } else if (element instanceof DirectoryPackagingElement) { builder.append(((DirectoryPackagingElement)element).getDirectoryName()).append("/"); } else { builder.append(element.toString()); } builder.append("\n"); if (element instanceof CompositePackagingElement) { for (PackagingElement<?> child : ((CompositePackagingElement<?>)element).getChildren()) { builder.append(printToString(child, level + 1)); } } return builder.toString(); }