Merged V2.0 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5132 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5134 .
      - ScriptLocation#getInputStream
      - RMI Registry


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5166 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-02-16 05:47:08 +00:00
parent 22f523d12b
commit 4163ab8476
4 changed files with 24 additions and 6 deletions

View File

@@ -33,6 +33,19 @@ public class ClasspathScriptLocation implements ScriptLocation
ParameterCheck.mandatory("Location", location);
this.location = location;
}
/**
* @see org.alfresco.service.cmr.repository.ScriptLocation#getInputStream()
*/
public InputStream getInputStream()
{
InputStream stream = getClass().getClassLoader().getResourceAsStream(location);
if (stream == null)
{
throw new AlfrescoRuntimeException("Unable to load classpath resource: " + location);
}
return stream;
}
/**
* @see org.alfresco.service.cmr.repository.ScriptLocation#getReader()
@@ -83,5 +96,4 @@ public class ClasspathScriptLocation implements ScriptLocation
{
return this.location.toString();
}
}

View File

@@ -3,6 +3,7 @@
*/
package org.alfresco.service.cmr.repository;
import java.io.InputStream;
import java.io.Reader;
/**
@@ -13,6 +14,13 @@ import java.io.Reader;
*/
public interface ScriptLocation
{
/**
* Returns an input stream to the contents of the script
*
* @return the input stream
*/
InputStream getInputStream();
/**
* Returns a reader to the contents of the script
*