Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.deployment

public Class DirectoryArchive

extends ArchiveBase
implements Archive
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.Archive
Imports
java.io.File, .FileFilter, .FileInputStream, .IOException, .InputStream, java.net.MalformedURLException, .URL, java.util.ArrayList, .Iterator, .List, java.util.logging.Level, .Logger, org.eclipse.persistence.jpa.Archive

This is an implementation of Archive when container returns a file: url that refers to a directory that contains an exploded jar file. e.g. file:/tmp/a_ear/ejb_jar
Author
[email protected]

Field Summary

Modifier and TypeField and Description
private File
directory

The directory this archive represents.

private List<String>
entries

The file entries that this archive contains.

private Logger
Inherited from org.eclipse.persistence.internal.jpa.deployment.ArchiveBase:
descriptorLocationrootURL

Constructor Summary

AccessConstructor and Description
public
DirectoryArchive(File directory, String descriptorLocation)

public
DirectoryArchive(File directory, String descriptorLocation, Logger logger)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.eclipse.persistence.jpa.Archive.close.

Close this archive and associated InputStream.
public Iterator<String>
public InputStream
getEntry(String
the file name relative to the root of the module.
entryPath
)

Implements abstract org.eclipse.persistence.internal.jpa.deployment.ArchiveBase.getEntry.

Implements org.eclipse.persistence.jpa.Archive.getEntry.

Returns the InputStream for the given entry name.
public URL
getEntryAsURL(String
the file name relative to the root of the module.
entryPath
)

Implements org.eclipse.persistence.jpa.Archive.getEntryAsURL.

Returns the URL for the given entry name.
private File
getFile(String entryPath)

private void
init(File top, File directory)

Inherited from org.eclipse.persistence.internal.jpa.deployment.ArchiveBase:
getDescriptorLocationgetDescriptorStreamgetRootURLsetDescriptorLocationsetRootURLtoString

Field Detail

directoryback to summary
private File directory

The directory this archive represents.

entriesback to summary
private List<String> entries

The file entries that this archive contains.

loggerback to summary
private Logger logger
Annotations
@SuppressWarnings:unused

Constructor Detail

DirectoryArchiveback to summary
public DirectoryArchive(File directory, String descriptorLocation) throws MalformedURLException
Annotations
@SuppressWarnings:deprecation
DirectoryArchiveback to summary
public DirectoryArchive(File directory, String descriptorLocation, Logger logger) throws MalformedURLException

Method Detail

closeback to summary
public void close()

Implements org.eclipse.persistence.jpa.Archive.close.

Doc from org.eclipse.persistence.jpa.Archive.close.

Close this archive and associated InputStream.

Annotations
@Override
getEntriesback to summary
public Iterator<String> getEntries()

Implements org.eclipse.persistence.jpa.Archive.getEntries.

Doc from org.eclipse.persistence.jpa.Archive.getEntries.

Returns an java.util.Iterator of the file entries. Each String represents a file name relative to the root of the module.

Annotations
@Override
getEntryback to summary
public InputStream getEntry(String entryPath) throws IOException

Implements abstract org.eclipse.persistence.internal.jpa.deployment.ArchiveBase.getEntry.

Implements org.eclipse.persistence.jpa.Archive.getEntry.

Doc from org.eclipse.persistence.jpa.Archive.getEntry.

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.

Parameters
entryPath:String

the file name relative to the root of the module.

Returns:InputStream

the InputStream for the given entry name or null if not found.

Annotations
@Override
getEntryAsURLback to summary
public URL getEntryAsURL(String entryPath) throws IOException

Implements org.eclipse.persistence.jpa.Archive.getEntryAsURL.

Doc from org.eclipse.persistence.jpa.Archive.getEntryAsURL.

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.

Parameters
entryPath:String

the file name relative to the root of the module.

Returns:URL

the URL for the given entry name or null if not found.

Annotations
@Override
getFileback to summary
private File getFile(String entryPath)
initback to summary
private void init(File top, File directory)