forked from Qortal/qortal
Small bug fixes
This commit is contained in:
parent
644ab27186
commit
a7b31ab1f9
@ -596,10 +596,6 @@ public class ArbitraryResource {
|
|||||||
|
|
||||||
private HttpServletResponse download(Service service, String name, String identifier, String filepath, boolean rebuild) {
|
private HttpServletResponse download(Service service, String name, String identifier, String filepath, boolean rebuild) {
|
||||||
|
|
||||||
if (filepath == null) {
|
|
||||||
throw ApiExceptionFactory.INSTANCE.createCustomException(request, ApiError.INVALID_CRITERIA, "Missing filepath");
|
|
||||||
}
|
|
||||||
|
|
||||||
ArbitraryDataReader arbitraryDataReader = new ArbitraryDataReader(name, ArbitraryDataFile.ResourceIdType.NAME, service, identifier);
|
ArbitraryDataReader arbitraryDataReader = new ArbitraryDataReader(name, ArbitraryDataFile.ResourceIdType.NAME, service, identifier);
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@ -622,7 +618,7 @@ public class ArbitraryResource {
|
|||||||
}
|
}
|
||||||
java.nio.file.Path outputPath = arbitraryDataReader.getFilePath();
|
java.nio.file.Path outputPath = arbitraryDataReader.getFilePath();
|
||||||
|
|
||||||
if (filepath.isEmpty()) {
|
if (filepath == null || filepath.isEmpty()) {
|
||||||
// No file path supplied - so check if this is a single file resource
|
// No file path supplied - so check if this is a single file resource
|
||||||
String[] files = ArrayUtils.removeElement(outputPath.toFile().list(), ".qortal");
|
String[] files = ArrayUtils.removeElement(outputPath.toFile().list(), ".qortal");
|
||||||
if (files.length == 1) {
|
if (files.length == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user