Package eu.bandm.tools.util.classes
Class Resource
java.lang.Object
eu.bandm.tools.util.classes.Resource
Auxiliary methods and auxiliary application for dealing with "resources" in the
Java sense = non-class files in a class-file tree.
(The
main(java.lang.String[])
application is often called by Makefiles etc.)-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyToFile
(Class<?> cl, String name, File target) Extract a resource file from the classloader-world into the normal file system.static void
copyToFile
(ClassLoader cl, String name, File target) Extract a resource file from the classloader-world into the normal file system.static void
Command line tool to extract a resource relative to a given class out of a class tree into the normal file system.
-
Constructor Details
-
Resource
public Resource()
-
-
Method Details
-
copyToFile
Extract a resource file from the classloader-world into the normal file system.- Parameters:
cl
- the class relative to which the resource is adressed.name
- a path relative to this class identifying the resourcetarget
- where to copy it.- Throws:
IOException
-
copyToFile
Extract a resource file from the classloader-world into the normal file system.- Parameters:
cl
- class loader relative to which the resource is adressed.name
- a path relative to this class identifying the resourcetarget
- where to copy it.- Throws:
IOException
-
main
Command line tool to extract a resource relative to a given class out of a class tree into the normal file system. The default class loader is used, as with a simpleClass.forName(String)
.arg[0] = classname arg[1] = relative path from class to resource arg[2] = filename to store
- Throws:
ClassNotFoundException
IOException
-