StringBuilder sb = new StringBuilder();
sb.append(String.format("{\"authentication\":\"%s\",\"enablePolicy\":%s", this.oauthEnabled ? "oauth" : "basic",
String.valueOf(this.policyEnabled)));
- if (this.transportPceGuiUrl != null && this.transportPceGuiUrl.length() > 0) {
- sb.append(String.format(",\"transportpceUrl\":\"%s\"}", this.transportPceGuiUrl));
- } else {
- sb.append("}");
+ if (this.transportPceGuiUrl != null && !this.transportPceGuiUrl.isBlank()) {
+ sb.append(String.format(",\"transportpceUrl\":\"%s\"", this.transportPceGuiUrl));
}
+ sb.append("}");
return sb.toString();
}
*/
package org.onap.ccsdk.features.sdnr.wt.odlux;
+import com.google.common.io.Files;
+import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
public class ResFilesServlet extends HttpServlet {
private static final long serialVersionUID = -6807215213921798293L;
- private static Logger LOG = LoggerFactory.getLogger(ResFilesServlet.class);
-
+ private static final Logger LOG = LoggerFactory.getLogger(ResFilesServlet.class);
+ private static final String LOGO_OVERWRITE_FILENAME = "etc/logo.gif";
+ private static final String LOGO_URL="/odlux/images/onapLogo.gif";
private final IndexOdluxBundle indexBundle;
final String fn = req.getRequestURI();
LOG.debug("Get request with for URI: {}", fn);
+ if(LOGO_URL.equals(fn)) {
+ File f = new File(LOGO_OVERWRITE_FILENAME);
+ if(f.exists()) {
+ resp.setStatus(HttpURLConnection.HTTP_OK);
+ resp.setContentType("image/gif");
+ Files.copy(f, resp.getOutputStream());
+ return;
+ }
+ }
OdluxBundleLoader odluxBundleLoader = OdluxBundleLoaderImpl.getInstance();
if (odluxBundleLoader != null) {
String fileContent = odluxBundleLoader.getResourceContent(fn, indexBundle);
loader: "babel-loader"\r
}]\r
}, {\r
+ //don't minify images\r
test: /\.(png|gif|jpg|svg)$/,\r
use: [{\r
loader: 'url-loader',\r
options: {\r
- limit: 10000,\r
- name: './images/[hash].[ext]'\r
+ limit: 10,\r
+ name: './images/[name].[ext]'\r
}\r
}]\r
}]\r