Package com.sun.enterprise.deploy.shared
Class ArchiveFactory
- java.lang.Object
-
- com.sun.enterprise.deploy.shared.ArchiveFactory
-
@Service @Singleton public class ArchiveFactory extends Object
This implementation of the ArchiveFactory interface is capable of creating the right abstraction of the Archive interface depending on the protocol used in the URL.- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description static Logger
deplLogger
-
Constructor Summary
Constructors Constructor Description ArchiveFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WritableArchive
createArchive(File path)
WritableArchive
createArchive(String protocol, File path)
WritableArchive
createArchive(String protocol, URI path)
WritableArchive
createArchive(URI path)
Creates a new archivist using the URL as the path.ReadableArchive
openArchive(File path)
ReadableArchive
openArchive(File path, DeployCommandParameters properties)
It first consultsReadableArchiveFactory
to get an archive, if it does not get then delegates toopenArchive(java.net.URI)
.ReadableArchive
openArchive(URI path)
Opens an existing archivist using the URL as the path.
-
-
-
Field Detail
-
deplLogger
public static final Logger deplLogger
-
-
Method Detail
-
createArchive
public WritableArchive createArchive(File path) throws IOException
- Throws:
IOException
-
createArchive
public WritableArchive createArchive(String protocol, File path) throws IOException
- Throws:
IOException
-
openArchive
public ReadableArchive openArchive(File path) throws IOException
- Throws:
IOException
-
createArchive
public WritableArchive createArchive(URI path) throws IOException
Creates a new archivist using the URL as the path. The URL protocol will define the type of desired archive (jar, file, etc)- Parameters:
path
- to the archive- Returns:
- the apropriate archive
- Throws:
IOException
-
createArchive
public WritableArchive createArchive(String protocol, URI path) throws IOException
- Throws:
IOException
-
openArchive
public ReadableArchive openArchive(File path, DeployCommandParameters properties) throws IOException
It first consultsReadableArchiveFactory
to get an archive, if it does not get then delegates toopenArchive(java.net.URI)
.- Parameters:
path
- Application archive, never nullproperties
- property bag, can contain for example deploy time properties. Never null- Returns:
- Gives
ReadableArchive
. - Throws:
IOException
-
openArchive
public ReadableArchive openArchive(URI path) throws IOException
Opens an existing archivist using the URL as the path. The URL protocol will defines the type of desired archive (jar, file, memory, etc...)- Parameters:
path
- url to the existing archive- Returns:
- the appropriate archive
- Throws:
IOException
-
-