Newer
Older
Sonia Zorba
committed
package it.inaf.oats.vospace;
Sara Bertocco
committed
import it.inaf.oats.vospace.datamodel.NodeUtils;
import it.inaf.oats.vospace.exception.InvalidURIException;
Sonia Zorba
committed
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
public abstract class BaseNodeController {
@Autowired
private HttpServletRequest servletRequest;
protected String getPath() {
String requestURL = servletRequest.getRequestURL().toString();
try {
return NodeUtils.getPathFromRequestURLString(requestURL);
} catch (IllegalArgumentException ex) {
throw new InvalidURIException(ex);
}
Sara Bertocco
committed
}
protected String getParentPath(String path) {
return NodeUtils.getParentPath(path);