Package org.w3c.tools.resources

Examples of org.w3c.tools.resources.Resource


    {
  // 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());
    }
    return okReply(request);
      } else {
View Full Code Here


    public static RequestDispatcher getRequestDispatcher(String name,
               ResourceReference rr,
               httpd server)
    {
  try {
      Resource res = rr.lock();
      if (! (res instanceof ServletDirectoryFrame)) {
    throw new IllegalArgumentException("Not a servlet container!");
      }
      ServletDirectoryFrame sdf = (ServletDirectoryFrame) res;
      // if (sdf.getServlet(name) != null) {
View Full Code Here

  String revision = null;

  protected synchronized void updateHeaders() {
      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

  double q       = 0.0 // quality (mime type one)
  double Q       = 0.0 // the big Q

  public String toString() {
      try {
    Resource res = variant.unsafeLock();
    String name = (String) res.getIdentifier() ;
    if ( name == null )
        name = "<noname>" ;
    return "[" + name
        + " qc=" + qc
        + " qs=" + qs
View Full Code Here

    protected synchronized CvsDirectory getCvsManager() {
  if (cvs == null) {
      ResourceReference rrp = resource.getParent();
      if (rrp != null) {
    try {
        Resource parent = rrp.lock();
        if (! (parent instanceof DirectoryResource)) {
      getServer().errlog(resource,
          "not a child of a DirectoryResource");
      throw new RuntimeException(
          "The server is misconfigured.");
View Full Code Here

    protected boolean isIndexed(String name) {
  ResourceReference rrp = resource.getParent();
  if (rrp != null) {
      try {
    Resource parent = rrp.lock();
    if (! (parent instanceof DirectoryResource)) {
        getServer().errlog(resource,
               "not a child of a DirectoryResource");
        throw new RuntimeException("The server is misconfigured.");
    }
View Full Code Here

  String tablecolor = "white";
  String parentpath = null;
  ResourceReference rr_parent = resource.getParent();
  try {
      Resource parent = rr_parent.lock();
      parentpath = parent.getURLPath();
  } catch (InvalidResourceException ex) {
      getServer().errlog(resource, "Invalid parent");
      throw new RuntimeException("The server is misconfigured.");
  } finally {
      rr_parent.unlock();
View Full Code Here

    if (action.equals("remove")) {
        //get the parent resource of our own resource
        ResourceReference rr = getResource().getParent();
        try {
      Resource res = rr.lock();
      DirectoryResource dirres = null;
      if (! (res instanceof DirectoryResource)) {
          getServer().errlog(res,
             "CvsFrame: not a child of a DirectoryResource");
          return error(this, request,
         "The server is misconfigured.",
         "The CVS Directory is not a children of a"+
         "Directory Resource.");
      }
      dirres = (DirectoryResource) res;
      for (int i=0; i < size; i++ ) {
          String name = names[i];
          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();
View Full Code Here

  super.setValue(idx, value);
  if ( idx == ATTR_IDENTIFIER ) {
       ResourceReference rr = getParent();
      if (rr != null) {
    try {
        Resource parent = rr.lock();
        if (parent.definesAttribute("directory")) {
      File pdir = (File) parent.getValue("directory", null);
      if ( pdir != null ) {
          // Compute and set our directory attribute:
          File dir = new File(pdir, getIdentifier()) ;
          super.setValue(ATTR_DIRECTORY, dir) ;
      }
View Full Code Here

  throws MultipleLockException
    {
  DummyResourceReference rr =
      (DummyResourceReference) getContentTypes();
  try {
      Resource r = rr.lock();
      r.delete();
  } catch (InvalidResourceException ex) {
  } finally {
      rr.invalidate();
      rr.unlock();
  }
View Full Code Here

TOP

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

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.