/** * Generate the index to the specified output stream. * * @param outputStream the output stream to write the index file * @throws IOException if a file cannot be indexed */ public void index(OutputStream outputStream) throws IOException { repository().save(requireNonNull(outputStream)); }
/** * Generate the index to the specified file. * * @param file the file to write the index file * @throws IOException if a file cannot be indexed */ public void index(File file) throws IOException { repository().save(requireNonNull(file)); }
/** * Generate the index to the specified output stream. * * @param outputStream the output stream to write the index file * @throws IOException if a file cannot be indexed */ public void index(OutputStream outputStream) throws IOException { repository().save(requireNonNull(outputStream)); }
/** * Generate the index to the specified file. * * @param file the file to write the index file * @throws IOException if a file cannot be indexed */ public void index(File file) throws IOException { repository().save(requireNonNull(file)); }
public void save(File location) throws IOException { if (location.getName() .endsWith(".gz")) compress = true; IO.mkdirs(location.getParentFile()); File tmp = IO.createTempFile(location.getParentFile(), "index", ".xml"); try (OutputStream out = IO.outputStream(tmp)) { save(out); } IO.rename(tmp, location); }
public void save(File location) throws IOException { if (location.getName() .endsWith(".gz")) compress = true; IO.mkdirs(location.getParentFile()); File tmp = IO.createTempFile(location.getParentFile(), "index", ".xml"); try (OutputStream out = IO.outputStream(tmp)) { save(out); } IO.rename(tmp, location); }
private Repository save(Repository repository) throws IOException, Exception { XMLResourceGenerator xrg = new XMLResourceGenerator(); xrg.repository(repository) .name(urlHash) .save(indexFile); return repository; }
private Repository save(Repository repository) throws IOException, Exception { XMLResourceGenerator xrg = new XMLResourceGenerator(); xrg.repository(repository) .name(urlHash) .save(indexFile); return repository; }
void save(String name, Collection<? extends Resource> resources, File location) throws Exception, IOException { XMLResourceGenerator generator = new XMLResourceGenerator(); generator.resources(resources); generator.name(name); generator.save(location); }
void save(String name, Collection<? extends Resource> resources, File location) throws Exception, IOException { XMLResourceGenerator generator = new XMLResourceGenerator(); generator.resources(resources); generator.name(name); generator.save(location); }
private Repository save(Repository repository) throws IOException, Exception { XMLResourceGenerator xrg = new XMLResourceGenerator(); xrg.repository(repository) .name(urlHash) .save(indexFile); return repository; }
private Repository save(Repository repository) throws IOException, Exception { XMLResourceGenerator xrg = new XMLResourceGenerator(); xrg.repository(repository) .name(urlHash) .save(indexFile); return repository; }
void save(String name, Collection<? extends Resource> resources, File location) throws Exception, IOException { XMLResourceGenerator generator = new XMLResourceGenerator(); generator.resources(resources); generator.name(name); generator.save(location); }
void save(String name, Collection<? extends Resource> resources, File location) throws Exception, IOException { XMLResourceGenerator generator = new XMLResourceGenerator(); generator.resources(resources); generator.name(name); generator.save(location); }
public void _index(IndexOptions options) throws Exception { ResourcesRepository repo = new ResourcesRepository(); List<URI> files = getFiles(); logger.debug("index files : {}", files); files.forEach(jar -> parse(repo, jar)); XMLResourceGenerator xrg = new XMLResourceGenerator().indent(2); if (options.name() != null) xrg.name(options.name()); if (options.referal() != null) xrg.referral(options.referal(), options.depth() <= 0 ? 3 : options.depth()); xrg.repository(repo); if (options.output() != null) { File f = IO.getFile(options.output()); f.getParentFile() .mkdirs(); xrg.compress() .save(f); } else { xrg.indent(2); xrg.save(System.out); } }
public void _index(IndexOptions options) throws Exception { ResourcesRepository repo = new ResourcesRepository(); List<URI> files = getFiles(); logger.debug("index files : {}", files); files.forEach(jar -> parse(repo, jar)); XMLResourceGenerator xrg = new XMLResourceGenerator().indent(2); if (options.name() != null) xrg.name(options.name()); if (options.referal() != null) xrg.referral(options.referal(), options.depth() <= 0 ? 3 : options.depth()); xrg.repository(repo); if (options.output() != null) { File f = IO.getFile(options.output()); f.getParentFile() .mkdirs(); xrg.compress() .save(f); } else { xrg.indent(2); xrg.save(System.out); } }
private void saveToXml(Project p, IMavenRepo storage, Archive index, ResourcesRepository repository) throws IOException, Exception { XMLResourceGenerator rg = new XMLResourceGenerator(); File tmpFile = File.createTempFile("index", ".xml"); try { rg.name(master.getRevision() .toString()); rg.repository(repository); rg.save(tmpFile); try (Release release = storage.release(master.getRevision(), p.getFlattenedProperties());) { release.force(); release.add(index, tmpFile); } } finally { IO.delete(tmpFile); } }
private void saveToXml(Project p, IMavenRepo storage, Archive index, ResourcesRepository repository) throws IOException, Exception { XMLResourceGenerator rg = new XMLResourceGenerator(); File tmpFile = File.createTempFile("index", ".xml"); try { rg.name(master.getRevision() .toString()); rg.repository(repository); rg.save(tmpFile); try (Release release = storage.release(master.getRevision(), p.getFlattenedProperties());) { release.force(); release.add(index, tmpFile); } } finally { IO.delete(tmpFile); } }