com.faunos.util.boot
Class JarDirectory

java.lang.Object
  extended by com.faunos.util.boot.JarDirectory
All Implemented Interfaces:
Directory

public class JarDirectory
extends Object
implements Directory

A code source-based Directory implementation.


Constructor Summary
JarDirectory()
           
JarDirectory(Class<?> clazz)
           
 
Method Summary
 File getDirectory()
          Returns the directory.
protected  File getDirectoryImpl(Class<?> clazz)
          Returns a directory based on the code source of the given class.
protected  String getPathRelativeToCodeSource()
          Returns a path relative used to determine the directory path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarDirectory

public JarDirectory()

JarDirectory

public JarDirectory(Class<?> clazz)
Method Detail

getDirectory

public File getDirectory()
Description copied from interface: Directory
Returns the directory. The File object returned is guaranteed to be an existing directory (although it may not have existed prior to invocation).

Specified by:
getDirectory in interface Directory

getDirectoryImpl

protected File getDirectoryImpl(Class<?> clazz)
Returns a directory based on the code source of the given class. This works only, of course, if the clazz was loaded from the file system.


getPathRelativeToCodeSource

protected String getPathRelativeToCodeSource()
Returns a path relative used to determine the directory path.

Returns:
the base implementation returns the current directory "."


SourceForge.net Logo