Site Sponsors:
Source Code as a Resource 

Loading Lately?

When it comes to programming, we all know that the term "resource" can mean just about anything. For the purpose of this post however, the term is herein being used to refer to any local file outside of those executable classes we need to run our application.

Simple Concepts

From Images to Resource Bundles, Java has three ways to locate & load classpath-relative resources: Class, Container, and System.

When it came time for me to include a stand-alone code template however, none of the tried-and-true resource loading techniques did the job. Why? Because rather than allowing the IDE to include all of the source code (so as to use the Class or Thread loader strategy for example), I simply wanted a way to resource a single custom source-code resource; A default template; A simple, single file. --One that that I desperately needed to include so as to better create a soon-to-be-released ENJO-Generaiton Tool.

Better than Television

So - bored almost to tears in the evening - while marooned at a client site last week I created a new tool. One designed to help me 'resource that single file.

Packing up the encoder & decoder API into a GUI Tool (yes, I was THAT Bored!) the overly ambitions project name I came up with so as to better share the locus with you is "OmniLoader."

Circulating as YASFP (Yet Another SourceForge Project) please allow me to share both the tool, as well as the simple technique with you now. Designed to generate a class that can hex-encode + embed ANY resource file, depending upon your requirement the technique could easily be expanded to resource-share arrays of bytes, class-named images, sounds, certificates, as well as any other resource we might realistically want to shove into a hex-dump.

Indeed, depending upon your need for stark efficiency, let me know if you would prefer a Base64 encode / decode option: The garbage-way American television is going these days, surely the next time I am marooned in a hotel room with only Cable as a companion you will probably get your wish. ... I will probably even write it twice.

Remember: For any professional, the Journey HAS ALWAYS BEEN the Destination, =)


[ view entry ] ( 1149 views )   |  permalink  |  related link

<<First <Back | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Next> Last>>