public BlobDownloadStrategy getStrategy() { return getBlobTransferPolicy().getDownloadStrategy(); } }
public URL upload(ActiveMQBlobMessage message) throws JMSException, IOException { if (file != null) { return getStrategy().uploadFile(message, file); } else { return getStrategy().uploadStream(message, in); } }
public BlobUploadStrategy getStrategy() { return getBlobTransferPolicy().getUploadStrategy(); } }
public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException { return getStrategy().getInputStream(message); }
public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException { getStrategy().deleteFile(message); }
public String getUploadUrl() { if (uploadUrl == null) { uploadUrl = getBrokerUploadUrl(); if (uploadUrl == null) { uploadUrl = getDefaultUploadUrl(); } } return uploadUrl; }
public BlobUploader(BlobTransferPolicy blobTransferPolicy, InputStream in) { // need to do a defensive copy this.blobTransferPolicy = blobTransferPolicy.copy(); this.in = in; }
public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { this.transferPolicy = transferPolicy; this.url = new URL(this.transferPolicy.getUploadUrl()); }
protected BlobTransferPolicy createBlobTransferPolicy() { return new BlobTransferPolicy(); }
public BlobUploadStrategy getUploadStrategy() { if (uploadStrategy == null) { uploadStrategy = createUploadStrategy(); } return uploadStrategy; }
public BlobDownloadStrategy getDownloadStrategy() { if(downloadStrategy == null) { downloadStrategy = createDownloadStrategy(); } return downloadStrategy; }
public void deleteFile() throws IOException, JMSException { blobDownloader.deleteFile(this); } }
public FileSystemBlobStrategy(final BlobTransferPolicy policy) throws MalformedURLException, URISyntaxException { this.policy = policy; createRootFolder(); }
public InputStream getInputStream() throws IOException, JMSException { if(blobDownloader == null) { return null; } return blobDownloader.getInputStream(this); }
public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException { try(FileInputStream fis = new FileInputStream(file)) { return uploadStream(message, fis); } }
/** * Returns a {@link FileInputStream} for the give {@link ActiveMQBlobMessage} */ public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException { return new FileInputStream(getFile(message)); }
public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException { try(FileInputStream fis = new FileInputStream(file)) { return uploadStream(message, fis); } }
public BlobUploader(BlobTransferPolicy blobTransferPolicy, File file) { // need to do a defensive copy this.blobTransferPolicy = blobTransferPolicy.copy(); this.file = file; }
/** * Returns a copy of this policy object */ public BlobTransferPolicy copy() { BlobTransferPolicy that = new BlobTransferPolicy(); that.defaultUploadUrl = this.defaultUploadUrl; that.brokerUploadUrl = this.brokerUploadUrl; that.uploadUrl = this.uploadUrl; that.bufferSize = this.bufferSize; that.uploadStrategy = this.uploadStrategy; that.downloadStrategy = this.downloadStrategy; return that; }
public BlobDownloader(BlobTransferPolicy transferPolicy) { // need to do a defensive copy this.blobTransferPolicy = transferPolicy.copy(); }