Add isContainedIn methods on all types of Resource, mostly with default impls
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@383 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
1ec23181fa
commit
3af9418add
|
@ -278,7 +278,10 @@ public abstract class Resource implements Serializable
|
|||
return newResource(url,useCaches);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isContainedIn (Resource r, Resource containingResource) throws MalformedURLException
|
||||
{
|
||||
return r.isContainedIn(containingResource);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected void finalize()
|
||||
|
@ -286,6 +289,9 @@ public abstract class Resource implements Serializable
|
|||
release();
|
||||
}
|
||||
|
||||
public abstract boolean isContainedIn (Resource r) throws MalformedURLException;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Release any resources held by the resource.
|
||||
*/
|
||||
|
@ -592,4 +598,7 @@ public abstract class Resource implements Serializable
|
|||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -439,4 +439,11 @@ public class ResourceCollection extends Resource
|
|||
return buffer.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isContainedIn(Resource r) throws MalformedURLException
|
||||
{
|
||||
// TODO could look at implementing the semantic of is this collection a subset of the Resource r?
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -289,4 +289,9 @@ public class URLResource extends Resource
|
|||
{
|
||||
return _useCaches;
|
||||
}
|
||||
|
||||
public boolean isContainedIn (Resource containingResource) throws MalformedURLException
|
||||
{
|
||||
return false; //TODO gregw check this!
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue