-/*gi
+/*
* In Samsung Ukraine R&D Center (SRK under a contract between)
* LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
* Copyright (C) 2017 Samsung Electronics Co., Ltd. All rights reserved.
doPost(requestString, null);
}
+ /**
+ * Post entity
+ *
+ * @param requestString request string
+ * @return entity type: Supplier
+ * @throws HttpSenderException in case of post troubles
+ */
public <T> void post(String requestString, Supplier<HttpEntity<T>> entitySupplier) throws HttpSenderException {
doPost(requestString, entitySupplier);
}
verifyLength(input);
while (input.startsWith("/")) {
- input = input.substring(1, input.length());
+ int length = input.length();
+ input = input.substring(1, length);
}
return input;
verifyLength(input);
while (input.endsWith("/")) {
- input = input.substring(0, input.length() - 2);
+ int length = input.length() - 2;
+ input = input.substring(0, length);
}
return input;
* @file Request
* @brief Base class for request
* @date Created : 11/7/2017
- * @date Modified :
+ * @date Modified : 11/7/2017
*/
@Configuration
-@PropertySources({
- @PropertySource("classpath:application.properties"),
- @PropertySource("classpath:iotivity.properties") })
+@PropertySources({ @PropertySource("classpath:application.properties"),
+ @PropertySource("classpath:iotivity.properties") })
+@SuppressWarnings("all")
public class HealthCheck {
private static final Logger LOG = Logger.getLogger(HealthCheck.class);
+ // CHECKSTYLE_OFF:Magic Number
private static void sleep() {
try {
- long ms = 1000;
+ final long ms = 1000;
Thread.sleep(ms);
} catch (InterruptedException e) {
LOG.debug("checkHost exception ", e);
Thread.currentThread().interrupt();
}
}
+ // CHECKSTYLE_ON:Magic Number
+ // CHECKSTYLE_OFF:Magic Number
private static boolean checkUrl(String url) {
LOG.info("health check " + url + "...");
try {
LOG.info(url + " not available...");
return false;
}
+ // CHECKSTYLE_ON:Magic Number
public static boolean checkSocket(String socket) {
LOG.info("health check " + socket + "...");
String[] parts = socket.split(":");
host = parts[0];
port = parts[1];
- }
- else {
+ } else {
LOG.info("socket has an incorrect format...");
return false;
}
/**
* Instantiates a new App config init.
*/
- protected HealthCheck(){
+ protected HealthCheck() {
}
}