Class JavaSourceOrClassFileResourceCachingFactoryImpl

java.lang.Object
org.splevo.jamopp.extraction.resource.JavaSourceOrClassFileResourceCachingFactoryImpl
All Implemented Interfaces:
Resource.Factory

public class JavaSourceOrClassFileResourceCachingFactoryImpl extends Object implements Resource.Factory
Factory for creating cache enabled JaMoPP java and class file resource.
  • Constructor Details

    • JavaSourceOrClassFileResourceCachingFactoryImpl

      public JavaSourceOrClassFileResourceCachingFactoryImpl(Resource.Factory factory, List<String> cacheDirectories)
      Constructor to set the base directory for internal reference cache.
      Parameters:
      factory - The resource factory to which the requests are forwarded.
      cacheDirectories - The absolute paths of directories containing cache files.
  • Method Details

    • createResource

      public Resource createResource(URI uri)
      Create a cache enabled resource for file scheme URIs.

      Depending on how the URI is created, one must call new File("myRelativePath").getCanonicalPath() before to ensure the URI starts with file://

      Otherwise a regular JaMoPP resource is created.
      Specified by:
      createResource in interface Resource.Factory
    • getReferenceCache

      public ReferenceCache getReferenceCache()
      Access the internal cache.
      Returns:
      The internally used cache.