Package org.w3c.tools.resources

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


    if (r_wrapper == null) { //lookup for wrapper
        httpd server =
      (httpd) ssiframe.getFileResource().getServer();
        ResourceReference rr_root = server.getRootReference();
        try {
      FramedResource root = (FramedResource) rr_root.lock();
      LookupState ls = new LookupState(code);
      LookupResult lr = new LookupResult(rr_root);
      ResourceReference wrap = null;
      if (root.lookup(ls,lr))
          wrap = lr.getTarget();
View Full Code Here


  // This request has no content
  ByteArrayOutputStream bout   = new ByteArrayOutputStream();

  try {
      Resource r = rr.lock();
      writer.writeResource(r, bout);
  } catch (IOException ex) {
      error(request, "bad request");
  } catch (InvalidResourceException ex) {
      error(request, "Invalid resource");
View Full Code Here

      ResourceReference wrap = null;
      if (root.lookup(ls,lr))
          wrap = lr.getTarget();
      if (wrap != null) {
          try {
        if (wrap.lock() instanceof ServletWrapper) {
            wrappers.put(code,wrap);
            r_wrapper = wrap;
        }
          } catch (InvalidResourceException ex) {
        ex.printStackTrace();
View Full Code Here

    public Reply remoteRegisterFrame(Request request)
  throws ProtocolException
    {
   ResourceReference rr = lookup(request);
   try {
       Resource r = rr.lock();
       if ( ! ( r instanceof FramedResource) )
     error(request, "can't add frame to non-framed resource");
       // Handle the request:
       try {
    InputStream in  = getInputStream(request);
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 Reply remoteUnregisterFrame(Request request)
  throws ProtocolException
    {
   ResourceReference rr = lookup(request);
   try{
       Resource r = rr.lock();
       if(!(r instanceof FramedResource)) {
     error(request, "Can't unregister frames from a non-framed" +
           " resource");
       }
       try {
View Full Code Here

      String            rname = (String) resources.elementAt(i) ;
      ResourceReference rr    = null;
      Resource          r     = null;
      try {
    rr = dresource.lookup(rname) ;
    r = rr.lock();
    // may throw InvalidResourceException

    if ( r instanceof DirectoryResource ) {
        sb.append("application/x-navidir "+
            rname+
View Full Code Here

  throws ProtocolException
    {
   // Check target resource class:
   ResourceReference rr = lookup(request);
   try {
       Resource r = rr.lock();
       if ( ! ( r instanceof ContainerInterface) )
     error(request, "can't add child in non-container");
       // Handle request:
       try {
    InputStream in = getInputStream(request);
View Full Code Here

    {
  // Check target resource class:
  ResourceReference rr = lookup(request);
  // Handle request:
  try {
      Resource r = rr.lock();
      if(r != null) {
    if (r instanceof org.w3c.tools.resources.DirectoryResource) {
        org.w3c.tools.resources.DirectoryResource dir =
      (org.w3c.tools.resources.DirectoryResource) r;
        dir.reindex(rec);
View Full Code Here

    {
  // Check target resource class:
  ResourceReference rr = lookup(request);
  // Handle request:
  try {
      Resource r = rr.lock();
      if(r != null) {
    try {
        r.delete();
    } catch (MultipleLockException ex) {
        error(request, ex.getMessage());
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.