-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPMRPP-82591 || Logs with attachments null pointer #949
Changes from 4 commits
ac5a747
c378850
fb01d82
bd1cabc
bbd1137
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,9 @@ public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler | |
|
||
@Override | ||
public String save(String filePath, InputStream inputStream) { | ||
if (filePath == null){ | ||
return ""; | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
try { | ||
if (!blobStore.containerExists(storedFile.getBucket())) { | ||
|
@@ -69,6 +72,9 @@ public String save(String filePath, InputStream inputStream) { | |
|
||
@Override | ||
public InputStream load(String filePath) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); | ||
if (fileBlob != null) { | ||
|
@@ -83,6 +89,9 @@ public InputStream load(String filePath) { | |
|
||
@Override | ||
public boolean exists(String filePath) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return false; | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
if (blobStore.containerExists(storedFile.getBucket())) { | ||
return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); | ||
|
@@ -94,6 +103,9 @@ public boolean exists(String filePath) { | |
|
||
@Override | ||
public void delete(String filePath) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return; | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
try { | ||
blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,9 @@ public S3DataStore(BlobStore blobStore, String bucketPrefix, String bucketPostfi | |
|
||
@Override | ||
public String save(String filePath, InputStream inputStream) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return ""; | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
try { | ||
if (!blobStore.containerExists(storedFile.getBucket())) { | ||
|
@@ -102,6 +105,10 @@ public String save(String filePath, InputStream inputStream) { | |
|
||
@Override | ||
public InputStream load(String filePath) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
LOGGER.error("Unable to find file"); | ||
throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); | ||
if (fileBlob != null) { | ||
|
@@ -117,12 +124,18 @@ public InputStream load(String filePath) { | |
|
||
@Override | ||
public boolean exists(String filePath) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return false; | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); | ||
} | ||
|
||
@Override | ||
public void delete(String filePath) { | ||
if (filePath == null){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return; | ||
} | ||
StoredFile storedFile = getStoredFile(filePath); | ||
try { | ||
blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WhitespaceAround: '{' is not preceded with whitespace.