Package org.w3c.tools.resources

Examples of org.w3c.tools.resources.ResourceReference.lock()


  ResourceReference rr = request.getTargetResource();
  String            k  = request.getURL().toExternalForm();
  Resource          r  = null;
  if (rr != null) {
    try {
      r = rr.lock();
      if ( r instanceof FileResource )
        k = ((FileResource) r).getFile().getAbsolutePath().toString();
    } catch (InvalidResourceException ex) {
      // continue
    } finally {
View Full Code Here


  ResourceReference rr = request.getTargetResource();
  String            k  = request.getURL().toExternalForm();
  Resource          r  = null;
  if (rr != null) {
    try {
      r = rr.lock();
      if ( r instanceof FileResource )
        k = ((FileResource) r).getFile().getAbsolutePath().toString();
    } catch (InvalidResourceException ex) {
      // continue
    } finally {
View Full Code Here

  ResourceReference rr = lookupResource(name);
  if (rr != null)
      return rr;
  rr = new Reference(this, name, defs);
  try {
      Resource res = rr.lock();
      if (res == null)
    return null;
  } catch (InvalidResourceException ex) {
      return null;
  } finally {
View Full Code Here

      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) {
View Full Code Here

      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;
View Full Code Here

      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;
View Full Code Here

          request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
      error.setContent("Unable to unlock, no request state");
      throw new HTTPException(error);
        } else {
      try {
          DAVFrame fr = (DAVFrame)rr.lock();
          fr.unlock();
      } catch (Exception ex) {
          ex.printStackTrace();
          Reply error =
        request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
View Full Code Here

        (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

    public String toString() {
  ResourceReference rr = (ResourceReference) getSource();
  String ssource = null;
  try {
      Resource resource = rr.lock();
      ssource = resource.getURLPath();
  } catch (InvalidResourceException ex) {
      ssource = "invalid";
  } catch (Exception ex) {
      ssource = "invalid"
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) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.