(Link link)
| 1058 | } |
| 1059 | |
| 1060 | public static File createOutboundFile(Link link) { |
| 1061 | String template; |
| 1062 | if (link != null && link.getId() != null) { |
| 1063 | template = "out_" + link.getId() + ".%d"; |
| 1064 | } else { |
| 1065 | template = "out_random.%d"; |
| 1066 | } |
| 1067 | int i = 0; |
| 1068 | File f = new File(getInbound() + File.separator |
| 1069 | + String.format(template, i)); |
| 1070 | while (f.exists()) { |
| 1071 | i++; |
| 1072 | f = new File(getInbound() + File.separator |
| 1073 | + String.format(template, i)); |
| 1074 | } |
| 1075 | return f; |
| 1076 | } |
| 1077 | |
| 1078 | private static File createInboundFile(boolean secure) { |
| 1079 | String template = ((secure) ? "s" : "u") + "inb%d.pkt"; |
no test coverage detected