* Get ContainerResource listing
* @param refresh should we refresh the listing?
* @return a boolean (true if refreshed)
*/
public boolean computeContainerListing(boolean refresh) {
ContainerResource cresource = (ContainerResource)resource;
synchronized (cresource) {
if ((refresh) ||
(listing == null) ||
(cresource.getLastModified() > listing_stamp) ||
(getLastModified() > listing_stamp)) {
Class http_class = null;
try {
http_class =
Class.forName("org.w3c.jigsaw.frames.HTTPFrame");
} catch (ClassNotFoundException ex) {
http_class = null;
}
Enumeration e = cresource.enumerateResourceIdentifiers();
Vector resources = Sorter.sortStringEnumeration(e) ;
HtmlGenerator g =
new HtmlGenerator("Index of "+cresource.getIdentifier());
// Add style link
addStyleSheet(g);
g.append("<h1>"+cresource.getIdentifier()+"</h1>");
// Link to the parent, when possible:
if ( cresource.getParent() != null ) {
g.append("<p><a href=\"..\">Parent</a><br>");
}
// List the children:
for (int i = 0 ; i < resources.size() ; i++) {
String name = (String) resources.elementAt(i);
ResourceReference rr = null;
long size = -1;
rr = cresource.lookup(name);
FramedResource resource = null;
if (rr != null) {
try {
resource = (FramedResource) rr.unsafeLock();
// remove manually deleted FileResources