Package org.w3c.tools.resources

Examples of org.w3c.tools.resources.FramedResource


  df = new SimpleDateFormat ("yyyy MMM dd - HH:mm:ss zzz");
  df.setTimeZone(TimeZone.getTimeZone("GMT"));

  StringBuffer buffer = new StringBuffer(100);
  try {
      FramedResource resource = (FramedResource) rr.lock();
      if (name == null)
    name = resource.getIdentifier();
      if (even) {
    buffer.append("<tr class=\"evenlist\" align=\"left\" "
            + "valign=\"bottom\">");
      } else {
    buffer.append("<tr class=\"oddlist\" align=\"left\" "
            + "valign=\"bottom\">")
      }
      HTTPFrame itsframe = null;
      if (httpClass != null)
    itsframe = (HTTPFrame)resource.getFrame(httpClass);
      if (itsframe instanceof CvsFrame) {
    buffer.append("<td></td>");
      } else {
    buffer.append("<td>");
    buffer.append("<INPUT TYPE=\"CHECKBOX\" NAME=\"" + name
            + "\"> ");
    buffer.append("</td>");
      }
      buffer.append("<td>");
      if (itsframe != null) {
    String icon = itsframe.getIcon() ;
    if ( icon != null )
        buffer.append("<IMG SRC=\""+
          getIconDirectory() +"/" + icon+
          "\">");
    // Resource's name with link:
    buffer.append("<A HREF=\""+resource.getURLPath()+
            "\">"+name+"</A>");
    // resource's title, if any:
    String title = itsframe.getTitle();
    if (title != null) {
        buffer.append("</td><td>"+title);
    } else {
       buffer.append("</td><td>");
    }
    int clength = itsframe.getContentLength();
    if (clength != -1) {
        int kcl = clength / 1024;
        buffer.append("</td><td>[ " + kcl + " kB ]");
    } else {
        buffer.append("</td><td>-");
    }
    long clm = itsframe.getLastModified();
    if (clm != -1) {
        buffer.append("</td><td>"+ df.format(new Date(clm)));
    } else {
        buffer.append("</td><td>-");
    }
      } else {
    // Resource's name with link:
    buffer.append("<A HREF=\""+resource.getURLPath()+
            "\">"+name+"</A>"+" Not available via HTTP");
    buffer.append("</td><td></td><td></td><td>\n");
      }
      buffer.append("</td></tr>\n");
  } catch (InvalidResourceException ex) {
View Full Code Here


    String listername = getResource().getIdentifier();
    // List the children:
    g.append("<table border=\"0\">\n");

    ResourceReference rr       = null;
    FramedResource    resource = null;
    String            name     = null;
    //ugly hack to put CVS link first
    rr = dirResource.lookup("CVS");
    if (rr != null) {
        g.append(getResourceLine(rr, "CVS", false));
View Full Code Here

    }
    try {
        // because the root eats the lookup state components
        // we have to return true.
        // Should not be continued by the caller.
        FramedResource res = (FramedResource)root.lock();
        boolean done = res.lookup(ls, lr);
        if (! done)
      lr.setTarget(null);
        return true;
    } catch (InvalidResourceException ex) {
        // should never happen with the root resource
        ex.printStackTrace();
    } finally {
        root.unlock();
    }
    return true; // should never be reached
      } else {
    request.setState(STATE_CONTENT_LOCATION, "true");
    // return the index file.
    String index = getIndex();
    if ( index != null && index.length() > 0) {
        ResourceReference root = getLocalRootResource();
        try {
      DirectoryResource dir =
          (DirectoryResource)root.lock();
      ResourceReference rr = dir.lookup(index);
      if (rr != null) {
          try {
        FramedResource rindex =
            (FramedResource) rr.lock();
        return rindex.lookup(ls,lr);
          } catch (InvalidResourceException ex) {
          } finally {
        rr.unlock();
          }
      }
View Full Code Here

      // don't give a damn
  }
  if (frame != null)
      return;
  statistics = new Stats(this);
  statsres = new FramedResource(); // create an empty resource
  statsres.registerFrame(statistics, new Hashtable(1));
  drr = new DummyResourceReference(statsres);
    }   
View Full Code Here

      }
      // verify that the target resource is putable
      ResourceReference rr = request.getTargetResource();
      if (rr != null) {
    try {
        FramedResource target = (FramedResource) rr.lock();
        HTTPFrame frame = null;
        try {
      frame = (HTTPFrame) target.getFrame(
         Class.forName("org.w3c.jigsaw.frames.HTTPFrame"));
        } catch (ClassNotFoundException cex) {
      cex.printStackTrace();
      //big big problem ...
        }
View Full Code Here

    if (queue.debug)
        System.out.println("[QUEUE] : getNextEvent()");
    Object src = event.getSource();
    ResourceReference rr = null;
    try {
        FramedResource source = null;
        if (src instanceof ResourceReference) {
      rr = (ResourceReference)src;
      Resource res = rr.lock();
      if (res instanceof FramedResource)
          source = (FramedResource) res;
      else
          source = null;
        } else if (src instanceof FramedResource) {
      source = (FramedResource) src;
        }
 
        if (source != null) {
      if (queue.debug)
          System.out.println("[QUEUE] : processEvent "+
                 event);
      source.processEvent(event);
        }
    } catch (InvalidResourceException ex) {
        if (queue.debug) {
      System.err.println("Exception occurred "+
             "in EventDispatcher:");
View Full Code Here

  if (resource instanceof ContainerResource) {
      Vector v = new Vector();
      ContainerResource cresource = (ContainerResource)resource;
      Enumeration e = cresource.enumerateResourceIdentifiers();
      ResourceReference rr = null;
      FramedResource    fr = null;
      while (e.hasMoreElements()) {
    String name = (String)e.nextElement();
    rr = cresource.lookup(name);
    if (rr != null) {
        try {
      fr = (FramedResource) rr.lock();
      if (fr == resource) { // for root
          continue;
      }
      DAVFrame df = (DAVFrame)fr.getFrame(DAVFrame.class);
      if (df != null) {
          v.addElement(df.getResponse(request,
              dpf,
              document));
          if (deep && (fr instanceof ContainerResource)) {
View Full Code Here

    DAVFactory.createMultiStatus(document.getDocumentElement());
      boolean multistatus = false;
      // Children resource
      Enumeration       e = dresource.enumerateResourceIdentifiers();
      ResourceReference rr   = null;
      FramedResource    fr   = null;
      while (e.hasMoreElements()) {
    String name = (String)e.nextElement();
    rr = dresource.lookup(name);
    if (rr != null) {
        try {
      fr = (FramedResource) rr.lock();
      if (fr == resource) { // for root
          continue;
      }
      DAVFrame df   = (DAVFrame)fr.getFrame(DAVFrame.class);
      URL      dest = null;
      if (df != null) {
          try {
        dest = computeDestURL(destination, df);
          } catch (MalformedURLException ex) {
View Full Code Here

    DAVFactory.createMultiStatus(document.getDocumentElement());
      boolean multistatus = false;
      // Children resource
      Enumeration       e = dresource.enumerateResourceIdentifiers();
      ResourceReference rr   = null;
      FramedResource    fr   = null;
      while (e.hasMoreElements()) {
    String name = (String)e.nextElement();
    rr = dresource.lookup(name);
    if (rr != null) {
        try {
      fr = (FramedResource) rr.lock();
      if (fr == resource) { // for root
          continue;
      }
      DAVFrame df   = (DAVFrame)fr.getFrame(DAVFrame.class);
      URL      dest = null;
      if (df != null) {
          try {
        dest = computeDestURL(destination, df);
          } catch (MalformedURLException ex) {
View Full Code Here

          DirectoryResource dir =
        (DirectoryResource) resource;
          ResourceReference rr = dir.lookup(index);
          if (rr != null) {
        try {
            FramedResource rindex =
          (FramedResource) rr.lock();
            return rindex.lookup(ls,lr);
        } catch (InvalidResourceException ex) {
        } finally {
            rr.unlock();
        }
          }
View Full Code Here

TOP

Related Classes of org.w3c.tools.resources.FramedResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.