Virtual Tarball - Draft 3

by Jon 3/3/2008 3:16:00 AM

I finally got around to kicking the tires of my "virtual tarball" idea, which is basically an XML document that consists of HTML-renderable <ul> / <li> tags that describe the contents of an Internet-based directory structure. This allows a single URL to be used to fetch an entire set of files by using a single list of hyperlinks.

I prototyped this on the server side at cachefile.net using a REST-like approach. Basically, one would simply need to append the path of a known cached directory at cachefile.net to the following URL:

http://cachefile.net/svc/mrr/ [+ known path from root]

For example:

http://cachefile.net/svc/mrr/scripts/OpenAjax/

This would output the contents of the directory at http://cachefile.net/scripts/OpenAjax/ in XML / <li> format, with hyperlinks.

 

<div class="mrr">
    <label>
        Index of <span class="mrrbase">http://cachefile.net/scripts/OpenAjax/</span>
    </label>
    <ul class="mrrparent">
        <li>
            <a href="../">Parent</a>
        </li>
    </ul>
    <!--
        This is a mrr ("mirror") file, also a.k.a. a "virtual tarball".
        For more information, see
http://www.jondavis.net/blog/?tag=/virtual%20tarball
        -->
    <ul class="mrrdirlist">
        <li class="mrrdir">
            <a href="hub">hub</a>
            <ul class="mrrdirlist">
                <li class="mrrdir">
                    <a href="hub/0.6">0.6</a>
                    <ul class="mrrdirlist">
                        <li class="mrrdir">
                            <a href="hub/0.6/release">release</a>
                            <ul class="mrrdirlist">
                                <li class="mrrfile">
                                    <a href="hub/0.6/release/OpenAjax.js">OpenAjax.js</a>
                                </li>
                            </ul>
                        </li>
                        <li class="mrrdir">
                            <a href="hub/0.6/src">src</a>
                            <ul class="mrrdirlist">
                                <li class="mrrfile">
                                    <a href="hub/0.6/src/OpenAjax.js">OpenAjax.js</a>
                                </li>
                            </ul>
                        </li>
                        <li class="mrrdir">
                            <a href="hub/0.6/testsrc">testsrc</a>
                            <ul class="mrrdirlist">
                                <li class="mrrfile">
                                    <a href="hub/0.6/testsrc/TestSuite.html">TestSuite.html</a>
                                </li>
 
                              <!-- .... -->

                            </ul>
                        </li>
                        <li class="mrrfile">
                            <a href="hub/0.6/build.xml">build.xml</a>
                        </li>
                        <li class="mrrfile">
                            <a href="hub/0.6/index.html">index.html</a>
                        </li>
                    </ul>
                </li>
                <li class="mrrdir">
                    <a href="hub/1.0_build117">1.0_build117</a>
                    <ul class="mrrdirlist">
                        <li class="mrrdir">
                            <a href="hub/1.0_build117/release">release</a>
                            <ul class="mrrdirlist">
                                <li class="mrrfile">
                                    <a href="hub/1.0_build117/release/OpenAjax.js">OpenAjax.js</a>
                                </li>
                            </ul>
                        </li>
                        <li class="mrrdir">
                            <a href="hub/1.0_build117/src">src</a>
                            <ul class="mrrdirlist">
                                <li class="mrrfile">
                                    <a href="hub/1.0_build117/src/OpenAjax.js">OpenAjax.js</a>
                                </li>
                            </ul>
                        </li>
                        <li class="mrrdir">
                            <a href="hub/1.0_build117/testsrc">testsrc</a>
                            <ul class="mrrdirlist">
                                <li class="mrrfile">
                                    <a href="hub/1.0_build117/testsrc/TestSuite.html">TestSuite.html</a>
                                </li>
                                  <!-- ... -->
                            </ul>
                        </li>
                        <li class="mrrfile">
                            <a href="hub/1.0_build117/build.xml">build.xml</a>
                        </li>
                        <li class="mrrfile">
                            <a href="hub/1.0_build117/index.html">index.html</a>
                        </li>
                    </ul>
                </li>
                <li class="mrrfile">
                    <a href="hub/home.href">home.href</a>
                </li>
            </ul>
        </li>
        <li class="mrrfile">
            <a href="home.href">home.href</a>
        </li>
    </ul>
</div>

As an added bonus, you can also get HTML wrapping of the XML file by appending the querystring, "?format=html".

http://cachefile.net/svc/mrr/scripts/OpenAjax/?format=html (click to view) 

You can let your imagination take you wherever you want to go as to what you would do with such a tool from here. I'm opening the uncommented server-side source code for this. The PHP file for my proprietary implementation is here: http://www.jondavis.net/misc/cachefile_mrr_gen.txt

Unfortunately, I have a sinking feeling that this opens up security vulnerabilities. If anyone can spot any, please let me know. I already filter out "..". 

kick it on DotNetKicks.com

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

10/7/2008 9:17:20 PM


 

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Jon Davis Jon Davis (aka "stimpy77") is a software and web developer by day and a software and web enthusiast (geek) by night. He was recently a senior web engineer for the enthusiast division of a major magazine publishing company for nearly two years. He has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."
 
Jon is currently engaged in a short-term ASP.NET contract and is available for hire for short-term or permanent work in Phoenix or via telecommute.
E-mail me Send mail

Calendar

<<  October 2008  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in