org.ops4j.pax.url.dir.internal
Class FileTailImpl

java.lang.Object
  extended by org.ops4j.pax.url.dir.internal.FileTailImpl
All Implemented Interfaces:
FileTail

public class FileTailImpl
extends Object
implements FileTail

Finds resources of the current module under test just by given top-level parent (whatever that is) and name of the class under test using a narrowing approach.

Since:
May 30, 2008
Author:
Toni Menzel (tonit)

Field Summary
static org.apache.commons.logging.Log logger
           
 
Constructor Summary
FileTailImpl(File topLevelDir, String tailExpr)
           
 
Method Summary
protected  File findParentOfTail(File folder)
          Tries to find the parent of tail in sub folders of folder parameter.
 File getParentOfTail()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static final org.apache.commons.logging.Log logger
Constructor Detail

FileTailImpl

public FileTailImpl(File topLevelDir,
                    String tailExpr)
             throws IOException
Parameters:
topLevelDir - an existing folder on the local filesystem. Must be readable.
tailExpr - a relative path to a file in any depth under topLevelDir.
Throws:
IOException - if a problem while crawling occurs.
Method Detail

findParentOfTail

protected File findParentOfTail(File folder)
                         throws IOException
Tries to find the parent of tail in sub folders of folder parameter. Tail is a relative path to a file in any depth of folder parameter. It will recursively call this method trying to find the given tail's parent. Note: THIS is being called recursively !!

Parameters:
folder - local folder that is used as (current) root. Sub folders wll be crawled recursively.
Returns:
the parent folder of the given anchor
Throws:
IOException - if a problem occures while crawling subfolders of *folder*

getParentOfTail

public File getParentOfTail()
Specified by:
getParentOfTail in interface FileTail
Returns:
the found (by crawling) parent of tail.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2013 OPS4J - Open Participation Software for Java. All Rights Reserved.