incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r823458 - /sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
Date Fri, 09 Oct 2009 08:46:04 GMT
Author: cziegeler
Date: Fri Oct  9 08:46:03 2009
New Revision: 823458

URL: http://svn.apache.org/viewvc?rev=823458&view=rev
Log:
SLING-1142 : Ensure that script session is used in all relevant places.

Modified:
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java?rev=823458&r1=823457&r2=823458&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
Fri Oct  9 08:46:03 2009
@@ -128,7 +128,7 @@
      * @throws ScriptEvaluationException
      */
     public Object call(SlingBindings props, String method, Object... args) {
-        final String scriptName = getScriptResource().getPath();
+        final String scriptName = scriptResource.getPath();
 
         Bindings bindings = null;
         Reader reader = null;
@@ -302,7 +302,7 @@
     }
 
     public String getServletInfo() {
-        return "Script " + getScriptResource().getPath();
+        return "Script " + scriptResource.getPath();
     }
 
     public void destroy() {
@@ -327,17 +327,17 @@
     }
 
     public String getServletName() {
-        return getScriptResource().getPath();
+        return scriptResource.getPath();
     }
 
     // ---------- internal -----------------------------------------------------
 
     private Reader getScriptReader() throws IOException {
 
-        InputStream input = getScriptResource().adaptTo(InputStream.class);
+        InputStream input = scriptResource.adaptTo(InputStream.class);
         if (input == null) {
             throw new IOException("Cannot get a stream to the script resource "
-                + getScriptResource());
+                + scriptResource);
         }
 
         // Now know how to get the input stream, we still have to decide
@@ -345,7 +345,7 @@
         // UTF-8, which is a default in many places in JCR. Secondarily
         // we try to get a jcr:encoding property besides the data property
         // to provide a possible encoding
-        ResourceMetadata meta = getScriptResource().getResourceMetadata();
+        ResourceMetadata meta = scriptResource.getResourceMetadata();
         String encoding = meta.getCharacterEncoding();
         if (encoding == null) {
             encoding = "UTF-8";
@@ -522,7 +522,7 @@
     }
 
     private String getLoggerName() {
-        String name = getScriptResource().getPath();
+        String name = scriptResource.getPath();
         name = name.substring(1);       // cut-off leading slash
         name = name.replace('.', '$');  // extension separator as part of name
         name = name.replace('/', '.');  // hierarchy defined by dot



Mime
View raw message