/** Returns the host which is the source of the files */ public String fileSourceHost() { return fileRegistry.fileSourceHost(); }
public static String exportRegistry(FileRegistry registry) { List<FileRegistry.Entry> entries = registry.export(); StringBuilder builder = new StringBuilder(); builder.append(registry.fileSourceHost()).append('\n'); for (FileRegistry.Entry entry : entries) { builder.append(entry.relativePath).append(entryDelimiter).append(entry.reference.value()). append('\n'); } return builder.toString(); }
/** * Adds the given file to the associated application packages' registry of file and marks the file * for distribution to the given hosts. * <b>Note: This class receives ownership of the given collection.</b> * * @return the reference to the file, created by the application package */ public FileReference sendFileToHosts(String relativePath, Collection<Host> hosts) { FileReference reference = fileRegistry.addFile(relativePath); addToFilesToDistribute(reference, hosts); return reference; }
/** * Adds the given file to the associated application packages' registry of file and marks the file * for distribution to the given hosts. * <b>Note: This class receives ownership of the given collection.</b> * * @return the reference to the file, created by the application package */ public FileReference sendUriToHosts(String uri, Collection<Host> hosts) { FileReference reference = fileRegistry.addUri(uri); if (reference != null) { addToFilesToDistribute(reference, hosts); } return reference; }