Package org.w3c.tools.resources

Examples of org.w3c.tools.resources.Resource


    ResourceReference rr = null;
    try {
        FramedResource source = null;
        if (src instanceof ResourceReference) {
      rr = (ResourceReference)src;
      Resource res = rr.lock();
      if (res instanceof FramedResource)
          source = (FramedResource) res;
      else
          source = null;
        } else if (src instanceof FramedResource) {
View Full Code Here


    }

    protected PutedEntry lookupEntry(Request request) {
  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();
View Full Code Here

    }

    protected DeletedEntry lookupDelEntry(Request request) {
  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();
View Full Code Here

  lockCount++;
  if (entry == null)
      throw new InvalidResourceException(identifier,
                "This reference was invalidate");
  ResourceStore store = entry.getStore();
  Resource resource = store.lookupResource(identifier);
  if (debug) {
      if (defs.get("context") == null)
    System.out.println("**** Context null for : "+identifier);
      else if (((ResourceContext)(defs.get("context"))).getServer()
         == null)
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

    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"
  } finally {
View Full Code Here

  // repository.
  getRootRepository();
  if (! root_repository.exists()) {
      try {
    Class root_class = Class.forName(default_root_class);
    Resource root = (Resource) root_class.newInstance();
    if (defs == null)
        defs = new Hashtable(4);
    defs.put("identifier".intern(), default_root_name);
    defs.put("key".intern(), getRootKey());
    root.initialize(defs);
   
    NewStoreEntry entry = new NewStoreEntry(this,
              ROOT_REP,
              getRootKey());
    ResourceReference rr = entry.addResource(root, defs);
View Full Code Here

    public String toString() {
  ResourceReference rr = (ResourceReference) getSource();
  String ssource = null;
  String id = null;
  try {
      Resource resource = rr.lock();
      ssource = resource.getURLPath();
      id = resource.getIdentifier();
  } catch (InvalidResourceException ex) {
      ssource = "invalid";
  } catch (Exception ex) {
      ssource = "invalid"
  } finally {
View Full Code Here

  } catch (Exception ex) {
      r_target = null;
  }
  if (r_target != null) {
    try {
      Resource target = r_target.lock();
      if (! (target instanceof PutListResource) )
        r_target = null;
      else
        list = r_target;
    } catch (InvalidResourceException ex) {
View Full Code Here

           , File directory
           , String name
           , Hashtable defs) {
  File file = new File(directory, name) ;
  // Okay, dispatch on wether it is a file or a directory.
  Resource result = null;
  if ( file.isDirectory() )
      result = createDirectoryResource(directory, request, name, defs) ;
  else
      result = createFileResource(directory, request, name, defs) ;
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.