Logo Search packages:      
Sourcecode: libloader version File versions  Download package

ResourceKey org::jfree::resourceloader::loader::file::FileResourceLoader::createKey ( final Object  value,
final Map  factoryKeys 
) throws ResourceKeyCreationException [inline]

Creates a new resource key from the given object and the factory keys.

Parameters:
value 
factoryKeys 
Returns:
the created key.
Exceptions:
org.jfree.resourceloader.ResourceKeyCreationException if creating the key failed.

Definition at line 94 of file FileResourceLoader.java.

  {
    if (value instanceof File)
    {
      return new ResourceKey(FileResourceLoader.class.getName(), value, factoryKeys);
    }

    if (value instanceof String)
    {
      final File f = new File(String.valueOf(value));
      if (f.exists() && f.isFile())
      {
        return new ResourceKey(FileResourceLoader.class.getName(), f, factoryKeys);
      }
    }

    return null;
  }


Generated by  Doxygen 1.6.0   Back to index