Replaced string.equals() with string.isEmpty()

This commit is contained in:
AlphaX-Projects 2024-06-29 12:11:38 +02:00
parent d58fbab1b5
commit 806dc6d056
8 changed files with 8 additions and 8 deletions

View File

@ -82,7 +82,7 @@ public class HTMLParser {
}
public static boolean isHtmlFile(String path) {
if (path.endsWith(".html") || path.endsWith(".htm") || path.equals("")) {
if (path.endsWith(".html") || path.endsWith(".htm") || path.isEmpty()) {
return true;
}
return false;

View File

@ -80,7 +80,7 @@ public class GatewayResource {
private HttpServletResponse parsePath(String inPath, String qdnContext, String secret58, boolean includeResourceIdInPrefix, boolean async) {
if (inPath == null || inPath.equals("")) {
if (inPath == null || inPath.isEmpty()) {
// Assume not a real file
return ArbitraryDataRenderer.getResponse(response, 404, "Error 404: File Not Found");
}

View File

@ -491,7 +491,7 @@ public class ArbitraryResource {
List<ArbitraryTransactionData> transactionDataList;
if (query == null || query.equals("")) {
if (query == null || query.isEmpty()) {
transactionDataList = ArbitraryDataStorageManager.getInstance().listAllHostedTransactions(repository, limit, offset);
} else {
transactionDataList = ArbitraryDataStorageManager.getInstance().searchHostedTransactions(repository,query, limit, offset);

View File

@ -73,7 +73,7 @@ public class ArbitraryDataReader {
}
// If identifier is a blank string, or reserved keyword "default", treat it as null
if (identifier == null || identifier.equals("") || identifier.equals("default")) {
if (identifier == null || identifier.isEmpty() || identifier.equals("default")) {
identifier = null;
}

View File

@ -199,7 +199,7 @@ public class ArbitraryDataRenderer {
}
private String getFilename(String directory, String userPath) {
if (userPath == null || userPath.endsWith("/") || userPath.equals("")) {
if (userPath == null || userPath.endsWith("/") || userPath.isEmpty()) {
// Locate index file
List<String> indexFiles = ArbitraryDataRenderer.indexFiles();
for (String indexFile : indexFiles) {

View File

@ -52,7 +52,7 @@ public class ArbitraryDataResource {
this.service = service;
// If identifier is a blank string, or reserved keyword "default", treat it as null
if (identifier == null || identifier.equals("") || identifier.equals("default")) {
if (identifier == null || identifier.isEmpty() || identifier.equals("default")) {
identifier = null;
}
this.identifier = identifier;

View File

@ -81,7 +81,7 @@ public class ArbitraryDataTransactionBuilder {
this.service = service;
// If identifier is a blank string, or reserved keyword "default", treat it as null
if (identifier == null || identifier.equals("") || identifier.equals("default")) {
if (identifier == null || identifier.isEmpty() || identifier.equals("default")) {
identifier = null;
}
this.identifier = identifier;

View File

@ -78,7 +78,7 @@ public class ArbitraryDataWriter {
this.compression = compression;
// If identifier is a blank string, or reserved keyword "default", treat it as null
if (identifier == null || identifier.equals("") || identifier.equals("default")) {
if (identifier == null || identifier.isEmpty() || identifier.equals("default")) {
identifier = null;
}
this.identifier = identifier;