java.lang.Object
org.eclipse.persistence.internal.jpa.deployment.ArchiveBase
org.eclipse.persistence.internal.jpa.deployment.URLArchive
All Implemented Interfaces:
Archive
Direct Known Subclasses:
InMemoryArchive

public class URLArchive extends ArchiveBase implements Archive
This is an implementation of Archive when container returns a url that is not one of the familiar URL types like file or jar URLs. So, we can not recursively walk thru' its hierarchy. As a result getEntries() returns an empty collection.
  • Constructor Details

    • URLArchive

      public URLArchive(URL url, String descriptorLocation)
  • Method Details

    • getEntries

      public Iterator<String> getEntries()
      Description copied from interface: Archive
      Returns an Iterator of the file entries. Each String represents a file name relative to the root of the module.
      Specified by:
      getEntries in interface Archive
    • getEntry

      public InputStream getEntry(String entryPath) throws IOException
      Description copied from interface: Archive
      Returns the InputStream for the given entry name. Returns null if no such entry exists. The entry name must be relative to the root of the module.
      Specified by:
      getEntry in interface Archive
      Specified by:
      getEntry in class ArchiveBase
      Parameters:
      entryPath - the file name relative to the root of the module.
      Returns:
      the InputStream for the given entry name or null if not found.
      Throws:
      IOException
    • getEntryAsURL

      public URL getEntryAsURL(String entryPath) throws IOException
      Description copied from interface: Archive
      Returns the URL for the given entry name. Returns null if no such entry exists. The entry name must be relative to the root of the module.
      Specified by:
      getEntryAsURL in interface Archive
      Parameters:
      entryPath - the file name relative to the root of the module.
      Returns:
      the URL for the given entry name or null if not found.
      Throws:
      IOException
    • close

      public void close()
      Description copied from interface: Archive
      Close this archive and associated InputStream.
      Specified by:
      close in interface Archive