Package org.w3c.tools.resources

Examples of org.w3c.tools.resources.FileResource


        if (rr != null) {
      try {
          resource = (FramedResource) rr.unsafeLock();
          // remove manually deleted FileResources
          if( resource instanceof FileResource ) {
              FileResource fr = (FileResource)resource;
        if( !fr.getFile().exists() ) {
            try {
          fr.delete();
            } catch (MultipleLockException ex) {};
            continue;
        } else {
          size = fr.getFile().length();
        }
          }
          HTTPFrame itsframe = null;
          if (http_class != null)
        itsframe =
View Full Code Here


          ResourceReference childref = dirres.lookup(name);
          if (childref != null) {
        try {
            Resource children = childref.lock();
            if (children instanceof FileResource) {
          FileResource fres =
              (FileResource) children;
          // delete the file
          fres.getFile().delete();
          // delete the resource
          fres.delete();
            }
        } catch(MultipleLockException mex) {
            mex.printStackTrace();
            return error(this, request,
             "MultipleLockException: "+
View Full Code Here

     */
    protected Reply getFileResource(Request request)
  throws ProtocolException, ResourceException
    {
  // get our associated FileResource
  FileResource fres = getFileResource();
  // Create the HTML generator, and set titles:
  HtmlGenerator g = new HtmlGenerator("FancyFrame");
  g.append("<h1>FancyFrame output</h1>");
  // emit the message
  g.append("<p>",getMessage(),"</p>");
  // display information about our FileResource
  g.append("<h2> FileResource associated : </h2>");
  g.append("<ul><li>Identifier : ",fres.getIdentifier());
  g.append("<li>File : "+fres.getFile());
  g.append("<li>Last Modified Time : ",
     new Date(fres.getLastModified()).toString(),
     "</ul>");
  // now emit the reply
  Reply reply = createDefaultReply(request, HTTP.OK) ;
  reply.setStream(g) ;
  return reply ;
View Full Code Here

TOP

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

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.