Virtual Tarball - Draft 3

by Jon Davis 3. March 2008 03:16

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

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading




 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") 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 was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar