# Examples

## Create a JavaArchive

    JavaArchive jar = Archives.create("test.jar", JavaArchive.class);

## Create a WebArchive

    WebArchive jar = Archives.create("test.war", WebArchive.class);

## Create a ConvergedSipWebArchive (as per SIP Servlets 1.1 specification)

    ConvergedSipWebArchive jar = Archives.create("test.war", ConvergedSipWebArchive.class);

## Import existing zip file

    JavaArchive jar = Archives.create("test.jar", ZipImporter.class)
                .importZip("my.zip")
             .as(JavaArchive.class);

## Export to zip

    InputStream zipStream = Archives.create("test.jar", JavaArchive.class)
                .addClass(MyClass.class)
             .as(ZipExporter.class)
                .exportZip();