CE-1068: changes from review: allow multiple email address entry, fixed download urls, fixed localhost to use inbucket/filesystem

This commit is contained in:
Tim Chamberlain
2024-04-24 17:11:48 -05:00
parent 570d1a80b5
commit 9281d07e96
8 changed files with 165 additions and 18 deletions

View File

@ -51,7 +51,7 @@ public class FilesystemStorageAction extends AbstractFilesystemAction implements
try
{
String fullPath = getFullPath(storageInput);
File file = new File(fullPath);
File file = new File(fullPath);
if(!file.getParentFile().exists())
{
if(!file.getParentFile().mkdirs())
@ -100,4 +100,15 @@ public class FilesystemStorageAction extends AbstractFilesystemAction implements
}
}
/*******************************************************************************
**
*******************************************************************************/
@Override
public String getDownloadURL(StorageInput storageInput) throws QException
{
return ("file://" + getFullPath(storageInput));
}
}

View File

@ -112,7 +112,30 @@ public class S3StorageAction extends AbstractS3Action implements QStorageInterfa
}
catch(Exception e)
{
throw (new QException("Exception getting s3 input stream for file", e));
throw (new QException("Exception getting s3 input stream for file.", e));
}
}
/*******************************************************************************
**
*******************************************************************************/
@Override
public String getDownloadURL(StorageInput storageInput) throws QException
{
try
{
S3BackendMetaData backend = (S3BackendMetaData) storageInput.getBackend();
preAction(backend);
AmazonS3 amazonS3 = getS3Utils().getAmazonS3();
String fullPath = getFullPath(storageInput);
return (amazonS3.getUrl(backend.getBucketName(), fullPath).toString());
}
catch(Exception e)
{
throw (new QException("Exception getting the S3 download URL.", e));
}
}
@ -135,7 +158,7 @@ public class S3StorageAction extends AbstractS3Action implements QStorageInterfa
}
catch(Exception e)
{
throw (new QException("Exception making s3 file publicly available", e));
throw (new QException("Exception making s3 file publicly available.", e));
}
}