public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { this.transferPolicy = transferPolicy; this.url = new URL(this.transferPolicy.getUploadUrl()); }
/** * Create the root folder if not exist * * @throws MalformedURLException * @throws URISyntaxException */ protected void createRootFolder() throws MalformedURLException, URISyntaxException { rootFile = new File(new URL(policy.getUploadUrl()).toURI()); if (rootFile.exists() == false) { rootFile.mkdirs(); } else if (rootFile.isDirectory() == false) { throw new IllegalArgumentException("Given url is not a directory " + rootFile ); } } /*
protected URL createMessageURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException { return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString()); }
/** * Returns the upload strategy depending on the information from the * uploadURL. Currently supportet HTTP and FTP * * @return */ protected BlobUploadStrategy createUploadStrategy() { BlobUploadStrategy strategy; try { URL url = new URL(getUploadUrl()); if(url.getProtocol().equalsIgnoreCase("FTP")) { strategy = new FTPBlobUploadStrategy(this); } else if (url.getProtocol().equalsIgnoreCase("FILE")) { strategy = new FileSystemBlobStrategy(this); } else { strategy = new DefaultBlobUploadStrategy(this); } } catch (MalformedURLException e) { strategy = new DefaultBlobUploadStrategy(this); } catch (URISyntaxException e) { strategy = new DefaultBlobUploadStrategy(this); } return strategy; }
/** * Returns the download strategy depending on the information from the * uploadURL. Currently supportet HTTP and FTP * * @return */ protected BlobDownloadStrategy createDownloadStrategy() { BlobDownloadStrategy strategy; try { URL url = new URL(getUploadUrl()); if(url.getProtocol().equalsIgnoreCase("FTP")) { strategy = new FTPBlobDownloadStrategy(this); } else if (url.getProtocol().equalsIgnoreCase("FILE")) { strategy = new FileSystemBlobStrategy(this); } else { strategy = new DefaultBlobDownloadStrategy(this); } } catch (MalformedURLException e) { strategy = new DefaultBlobDownloadStrategy(this); } catch (URISyntaxException e) { strategy = new DefaultBlobDownloadStrategy(this); } return strategy; }
public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { this.transferPolicy = transferPolicy; this.url = new URL(this.transferPolicy.getUploadUrl()); }
public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { this.transferPolicy = transferPolicy; this.url = new URL(this.transferPolicy.getUploadUrl()); }
public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { this.transferPolicy = transferPolicy; this.url = new URL(this.transferPolicy.getUploadUrl()); }
public FTPStrategy(BlobTransferPolicy transferPolicy) throws MalformedURLException { this.transferPolicy = transferPolicy; this.url = new URL(this.transferPolicy.getUploadUrl()); }
/** * Create the root folder if not exist * * @throws MalformedURLException * @throws URISyntaxException */ protected void createRootFolder() throws MalformedURLException, URISyntaxException { rootFile = new File(new URL(policy.getUploadUrl()).toURI()); if (rootFile.exists() == false) { rootFile.mkdirs(); } else if (rootFile.isDirectory() == false) { throw new IllegalArgumentException("Given url is not a directory " + rootFile ); } } /*
/** * Create the root folder if not exist * * @throws MalformedURLException * @throws URISyntaxException */ protected void createRootFolder() throws MalformedURLException, URISyntaxException { rootFile = new File(new URL(policy.getUploadUrl()).toURI()); if (rootFile.exists() == false) { rootFile.mkdirs(); } else if (rootFile.isDirectory() == false) { throw new IllegalArgumentException("Given url is not a directory " + rootFile ); } } /*
/** * Create the root folder if not exist * * @throws MalformedURLException * @throws URISyntaxException */ protected void createRootFolder() throws MalformedURLException, URISyntaxException { rootFile = new File(new URL(policy.getUploadUrl()).toURI()); if (rootFile.exists() == false) { rootFile.mkdirs(); } else if (rootFile.isDirectory() == false) { throw new IllegalArgumentException("Given url is not a directory " + rootFile ); } } /*
/** * Create the root folder if not exist * * @throws MalformedURLException * @throws URISyntaxException */ protected void createRootFolder() throws MalformedURLException, URISyntaxException { rootFile = new File(new URL(policy.getUploadUrl()).toURI()); if (rootFile.exists() == false) { rootFile.mkdirs(); } else if (rootFile.isDirectory() == false) { throw new IllegalArgumentException("Given url is not a directory " + rootFile ); } } /*
protected URL createMessageURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException { return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString()); }
protected URL createMessageURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException { return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString()); }
protected URL createMessageURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException { return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString()); }
protected URL createMessageURL(ActiveMQBlobMessage message) throws JMSException, MalformedURLException { return new URL(transferPolicy.getUploadUrl() + message.getMessageId().toString()); }
/** * Returns the download strategy depending on the information from the * uploadURL. Currently supportet HTTP and FTP * * @return */ protected BlobDownloadStrategy createDownloadStrategy() { BlobDownloadStrategy strategy; try { URL url = new URL(getUploadUrl()); if(url.getProtocol().equalsIgnoreCase("FTP")) { strategy = new FTPBlobDownloadStrategy(this); } else if (url.getProtocol().equalsIgnoreCase("FILE")) { strategy = new FileSystemBlobStrategy(this); } else { strategy = new DefaultBlobDownloadStrategy(this); } } catch (MalformedURLException e) { strategy = new DefaultBlobDownloadStrategy(this); } catch (URISyntaxException e) { strategy = new DefaultBlobDownloadStrategy(this); } return strategy; }
/** * Returns the upload strategy depending on the information from the * uploadURL. Currently supportet HTTP and FTP * * @return */ protected BlobUploadStrategy createUploadStrategy() { BlobUploadStrategy strategy; try { URL url = new URL(getUploadUrl()); if(url.getProtocol().equalsIgnoreCase("FTP")) { strategy = new FTPBlobUploadStrategy(this); } else if (url.getProtocol().equalsIgnoreCase("FILE")) { strategy = new FileSystemBlobStrategy(this); } else { strategy = new DefaultBlobUploadStrategy(this); } } catch (MalformedURLException e) { strategy = new DefaultBlobUploadStrategy(this); } catch (URISyntaxException e) { strategy = new DefaultBlobUploadStrategy(this); } return strategy; }
/** * Returns the upload strategy depending on the information from the * uploadURL. Currently supportet HTTP and FTP * * @return */ protected BlobUploadStrategy createUploadStrategy() { BlobUploadStrategy strategy; try { URL url = new URL(getUploadUrl()); if(url.getProtocol().equalsIgnoreCase("FTP")) { strategy = new FTPBlobUploadStrategy(this); } else if (url.getProtocol().equalsIgnoreCase("FILE")) { strategy = new FileSystemBlobStrategy(this); } else { strategy = new DefaultBlobUploadStrategy(this); } } catch (MalformedURLException e) { strategy = new DefaultBlobUploadStrategy(this); } catch (URISyntaxException e) { strategy = new DefaultBlobUploadStrategy(this); } return strategy; }