Package org.w3c.tools.resources

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


      try {
    CvsFrame cvsframe = (CvsFrame) rr_cvsframe.lock();
    Resource res      = cvsframe.getResource();
    ResourceReference rr_dir = res.getParent();
    try {
        Resource parent = rr_dir.lock();
        if (parent instanceof ContainerResource) {
      ContainerResource dir = (ContainerResource) parent;
      ResourceReference rr_res = dir.lookup(name);
      if (rr_res == null) {
          this.setValue(ATTR_CONTENT_TYPE,
View Full Code Here


          this.setValue(ATTR_CONTENT_TYPE,
             org.w3c.www.mime.Utils.getMimeType(name));
          return;
      }
      try {
          res = rr_res.lock();
          if (res instanceof FileResource) {
        HTTPFrame httpFrame = (HTTPFrame)
            res.getFrame(
           Class.forName(
             "org.w3c.jigsaw.frames.HTTPFrame"));
View Full Code Here

  String best = null;

  ResourceReference rr = getResource().getParent();
  if (rr != null) {
      try {
    FramedResource p = (FramedResource)rr.lock();
    // if the father is a container (it should always be)
    if (p instanceof ContainerResource) {
        ContainerResource cr = (ContainerResource) p;
        Enumeration res_enum;
        res_enum = cr.enumerateResourceIdentifiers(false);
View Full Code Here

          ResourceReference rr_root,
          ResourceReference rr)
    {
  ResourceReference local_root = getLocalRoot(rr_root, rr);
  try {
      FramedResource root = (FramedResource)local_root.lock();
      LookupState    ls   = new LookupState(path);
      LookupResult   lr   = new LookupResult(local_root);
      if (root.lookup(ls,lr)) {
    ResourceReference  target = lr.getTarget();
    if (target != null) {
View Full Code Here

      LookupResult   lr   = new LookupResult(local_root);
      if (root.lookup(ls,lr)) {
    ResourceReference  target = lr.getTarget();
    if (target != null) {
        try {
      FramedResource res = (FramedResource)target.lock();
      if (res instanceof FileResource) {
          File file = ((FileResource)res).getFile();
          return file.getAbsolutePath();
      } else if (res instanceof DirectoryResource) {
          DirectoryResource dir = (DirectoryResource) res;
View Full Code Here

    String index = indexes[i];
    if ( index != null && index.length() > 0) {
        ResourceReference rr = dir.lookup(index);
        if (rr != null) {
      try {
          FramedResource ri = (FramedResource) rr.lock();
          if (ri instanceof FileResource) {
        FileResource fr = (FileResource) ri;
        File file = fr.getFile();
        return file.getAbsolutePath();
          } else {
View Full Code Here

      r_target = null;
  }
  //then return its context
  if (r_target != null) {
      try {
    Resource target = r_target.lock();
    if (target instanceof FramedResource) {
        ServletDirectoryFrame frame = (ServletDirectoryFrame)
      ((FramedResource) target).
          getFrame("org.w3c.jigsaw.servlet.ServletDirectoryFrame");
        if (frame != null)
View Full Code Here

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

          (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

  if (! path.startsWith("/")) {
      String uri = null;
      try {
    ResourceReference rrp = rr.lock().getParent();
    try {
        Resource r = rrp.lock();
        uri = r.getURLPath();
    } catch (InvalidResourceException irex) {
        return null;
    } finally {
        rrp.unlock();
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.