Calculates the name that a file would appear as inside of a ZIP file. @param __root The root path. @param __p The file to add. @return The ZIP compatible name. @throws NullPointerException On null arguments. @since 2016/03/21
(Path __root, Path __p)
| 752 | * @since 2016/03/21 |
| 753 | */ |
| 754 | private static String __zipName(Path __root, Path __p) |
| 755 | throws NullPointerException |
| 756 | { |
| 757 | // Check |
| 758 | if (__root == null || __p == null) |
| 759 | throw new NullPointerException(); |
| 760 | |
| 761 | // Calculate relative name |
| 762 | Path rel = __root.toAbsolutePath().relativize(__p.toAbsolutePath()); |
| 763 | |
| 764 | // Build name |
| 765 | StringBuilder sb = new StringBuilder(); |
| 766 | for (Path comp : rel) |
| 767 | { |
| 768 | // Prefix slash |
| 769 | if (sb.length() > 0) |
| 770 | sb.append('/'); |
| 771 | |
| 772 | // Add component |
| 773 | sb.append(comp); |
| 774 | } |
| 775 | |
| 776 | // Return it |
| 777 | return sb.toString(); |
| 778 | } |
| 779 | |
| 780 | /** |
| 781 | * This represents a single project which may be built. |
no test coverage detected