Skip to content

Commit

Permalink
Renamed "resourceName" to "name" for simplicity.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Oct 19, 2015
1 parent 0b4c1e3 commit 9fb9d61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -182,7 +182,7 @@ private DispatchResult doDispatch(PojoDispatcher dispatcher, PojoRequest req) {
} }


public static boolean serveDynamicPage(HttpExchange x, Object result, boolean hasEvent, Map<String, Object> config) { public static boolean serveDynamicPage(HttpExchange x, Object result, boolean hasEvent, Map<String, Object> config) {
String filename = x.resourceName() + ".html"; String filename = x.name() + ".html";
String firstFile = Conf.rootPath() + "/pages/" + filename; String firstFile = Conf.rootPath() + "/pages/" + filename;
String defaultFile = Conf.rootPathDefault() + "/pages/" + filename; String defaultFile = Conf.rootPathDefault() + "/pages/" + filename;
Res res = Res.from(filename, true, firstFile, defaultFile); Res res = Res.from(filename, true, firstFile, defaultFile);
Expand Down
2 changes: 1 addition & 1 deletion rapidoid-app/src/main/java/org/rapidoid/app/Scripting.java
Expand Up @@ -66,7 +66,7 @@ public void run() {
} }


private static CompiledScript script(HttpExchangeImpl x) { private static CompiledScript script(HttpExchangeImpl x) {
String scriptName = x.isGetReq() ? x.verbAndResourceName() : x.verb().toUpperCase() + "_" + x.resourceName(); String scriptName = x.isGetReq() ? x.verbAndResourceName() : x.verb().toUpperCase() + "_" + x.name();
String filename = scriptName + ".js"; String filename = scriptName + ".js";
String firstFile = Conf.rootPath() + "/" + filename; String firstFile = Conf.rootPath() + "/" + filename;
String defaultFile = Conf.rootPathDefault() + "/" + filename; String defaultFile = Conf.rootPathDefault() + "/" + filename;
Expand Down
Expand Up @@ -32,7 +32,7 @@ public interface HttpExchange extends Req, Resp, Runnable {


/* REQUEST: */ /* REQUEST: */


String resourceName(); String name();


String verbAndResourceName(); String verbAndResourceName();


Expand Down
Expand Up @@ -947,11 +947,11 @@ public synchronized HttpExchange authorize(Class<?> clazz) {


@Override @Override
public synchronized boolean serveStaticFile() { public synchronized boolean serveStaticFile() {
if (serveStaticFile(resourceName())) { if (serveStaticFile(name())) {
return true; return true;
} }


return !resourceNameHasExtension() && serveStaticFile(resourceName() + ".html"); return !resourceNameHasExtension() && serveStaticFile(name() + ".html");
} }


@Override @Override
Expand Down Expand Up @@ -1287,7 +1287,7 @@ public HttpExchangeImpl async() {
} }


@Override @Override
public synchronized String resourceName() { public synchronized String name() {
if (resourceName == null) { if (resourceName == null) {
resourceName = path().substring(1); resourceName = path().substring(1);


Expand All @@ -1307,11 +1307,11 @@ public synchronized String resourceName() {


@Override @Override
public synchronized String verbAndResourceName() { public synchronized String verbAndResourceName() {
return verb().toUpperCase() + "/" + resourceName(); return verb().toUpperCase() + "/" + name();
} }


public synchronized boolean resourceNameHasExtension() { public synchronized boolean resourceNameHasExtension() {
resourceName(); // make sure it is calculated name(); // make sure it is calculated
return resourceNameHasExtension; return resourceNameHasExtension;
} }


Expand Down

0 comments on commit 9fb9d61

Please sign in to comment.