Railo Extension - Ram Resource Info
Gert just tweeted about the "Ram Resource Info" being available on the preview site ( http://preview.getrailo.org/ExtensionProvider.cfc ). I thought I'd take a moment to show you how to install and use it.
Step 1.
Log into your local web context ( example: http://{your host}/railo-context/admin/web.cfm ) and underneath Extensions click on Providers. Type in "http://preview.getrailo.org/ExtensionProvider.cfc" into the input field and click save. Screenshot
Step 2. (Optional)
You can verify that this is working by clicking on the checkbox next to the provider and clicking the Verify button. Screenshot
Step 3.
Now that is done, go ahead and click on Extension-> Applications. Select the "Ram Resource Info" radio button and click Install. Screenshot - Once installed, you'll see a success message.
Using Ram Resource Info
If you did everything above correctly, you should see a new item in your navigation underneath Plugin called Ram Resource Info. Click on it and you'll see the application. Screenshot
At the moment, it doesn't look like it's doing much, but if we write up some CFML to populate the VFS (Virtual File System) - ram:///, we can see it in action.
Sample CFML Code to populate the VFS
<cfloop index="file" from="1" to="10">
<cfset fileWrite('ram:///test#file#.txt','blah')>
</cfloop>
<cfdirectory action="create" directory="ram:///stuff">
<cfloop index="file" from="1" to="10">
<cfset fileWrite('ram:///stuff/test#file#.txt','blah')>
</cfloop>
So, this is basically creating test1.txt -> test10.txt with the content of 'blah'. It's also creating a sub-directory called 'stuff' and creating 10 more text files inside of it. Go ahead and run the code (btw, there will be no output).
After running the code, go back and take a look at the Ram Resource Info page now and it should resemble this screenshot. As you can see, you can view all the files and folders in the ramdrive. You can download the files. You can navigate into the sub-directory called 'stuff' and see what files are available. You can navigate back up to the main ram drive space and then you can also use the check boxes available to delete particular files.
Hope this is useful and if there are any issues, please let us know!



I wasn't aware of this until just this morning, but ram:/// is specific to each web context. Case in point, my screenshots were showing everything I did on http://testbed/ - I went over to my http://localhost/ and installed the application and my ram:/// is empty.
If that's true, I think it's actually cool that Railo implemented VFS so that each web context gets its own RAM space.
----
Another thing. At the moment the ram resource is defined in each web context’s railo-web.xml.cfm file. The definition looks like this:
<resource-provider
scheme="ram"
class="railo.commons.io.res.type.ram.RamResourceProvider"
arguments="case-sensitive:true;lock-timeout:1000;"/>
If you now copy the above definition to the railo-server.xml file like follows:
<resource-provider
scheme="gram" <<< this scheme just says something like global RAM
class="railo.commons.io.res.type.ram.RamResourceProvider"
arguments="case-sensitive:true;lock-timeout:1000;"/>
and restart the server, you could actually use a global ram resource in order to share files across the server. You can of course use any other scheme for it. Then after that you can use it like this:
<cffile action=”copy” source=”c:\temp.txt” destination=”gram:///test.txt”>