org.webbitserver.helpers
Class ClassloaderResourceHelper
java.lang.Object
org.webbitserver.helpers.ClassloaderResourceHelper
public class ClassloaderResourceHelper
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassloaderResourceHelper
public ClassloaderResourceHelper()
listFilesRelativeToClass
public static Iterable<FileEntry> listFilesRelativeToClass(Class<?> clazz,
String subdirectory)
throws IOException
- Lists all files and directories relative to the classpath entry (jar or folder)
containing clazz, directly under subdirectory.
If clazz org.webbitserver.Foo is in folder /some/path/org/webbitserver/Foo.clazz,
will list files in /some/path/$subdirectory
If clazz org.webbitserver.Foo is in jar /some/path/webbit.jar,
will list files in /some/path/webbit.jar:$subdirectory
- Parameters:
clazz - Any class within the classpath entry to be listed.subdirectory - Subdirectory to list. Must be an absolute path, relative to the top level of the classpath entry.
- Returns:
- List of files directly in subdirectory, under the classpath entry containing clazz.
- Throws:
IOException
fileEntriesFor
public static Iterable<FileEntry> fileEntriesFor(File[] files)
Copyright © 2013. All Rights Reserved.