@Test public void localTemplateDownloaderTest() throws Exception { final String url = new File("pom.xml").toURI().toURL().toString(); final long defaultMaxTemplateSizeInBytes = TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES; final String tempDir = System.getProperty("java.io.tmpdir"); final TemplateDownloader td = new LocalTemplateDownloader(url, tempDir, defaultMaxTemplateSizeInBytes); final long bytes = td.download(true, null); assertThat(bytes, greaterThan(0L)); }
public LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback) { super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback); final String filename = new File(downloadUrl).getName(); this._toFile = toDir.endsWith(File.separator) ? toDir + filename : toDir + File.separator + filename; }
LocalTemplateDownloader extends TemplateDownloaderBase implements TemplateDownloader { public LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback) { super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback); final String filename = new File(downloadUrl).getName(); this._toFile = toDir.endsWith(File.separator) ? toDir + filename : toDir + File.separator + filename; } }
LocalTemplateDownloader extends TemplateDownloaderBase implements TemplateDownloader { public LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback) { super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback); final String filename = new File(downloadUrl).getName(); this._toFile = toDir.endsWith(File.separator) ? toDir + filename : toDir + File.separator + filename; } LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir,
                                   final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback);  LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir,
                                   final long maxTemplateSizeInBytes);  LocalTemplateDownloader(final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes); }
LocalTemplateDownloader extends TemplateDownloaderBase implements TemplateDownloader { public LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback) { super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback); final String filename = new File(downloadUrl).getName(); this._toFile = toDir.endsWith(File.separator) ? toDir + filename : toDir + File.separator + filename; } LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir,
                                   final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback);  LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir,
                                   final long maxTemplateSizeInBytes);  LocalTemplateDownloader(final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes); @Override long download(final boolean resume, final DownloadCompleteCallback callback); }
LocalTemplateDownloader extends TemplateDownloaderBase implements TemplateDownloader { public LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback) { super(storageLayer, downloadUrl, toDir, maxTemplateSizeInBytes, callback); final String filename = new File(downloadUrl).getName(); this._toFile = toDir.endsWith(File.separator) ? toDir + filename : toDir + File.separator + filename; } LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir,
                                   final long maxTemplateSizeInBytes, final DownloadCompleteCallback callback);  LocalTemplateDownloader(final StorageLayer storageLayer, final String downloadUrl, final String toDir,
                                   final long maxTemplateSizeInBytes);  LocalTemplateDownloader(final String downloadUrl, final String toDir, final long maxTemplateSizeInBytes); @Override long download(final boolean resume, final DownloadCompleteCallback callback); static final Logger s_logger; }