com.android.sdklib.internal.build
Class SignedJarBuilder

java.lang.Object
  extended by com.android.sdklib.internal.build.SignedJarBuilder

Deprecated. Use Android-Builder instead

@Deprecated
public class SignedJarBuilder
extends java.lang.Object

A Jar file builder with signature support.


Nested Class Summary
static interface SignedJarBuilder.IZipEntryFilter
          Deprecated. Classes which implement this interface provides a method to check whether a file should be added to a Jar file.
 
Constructor Summary
SignedJarBuilder(java.io.OutputStream out, java.security.PrivateKey key, java.security.cert.X509Certificate certificate)
          Deprecated. Creates a SignedJarBuilder with a given output stream, and signing information.
 
Method Summary
 void cleanUp()
          Deprecated. Clean up of the builder for interrupted workflow.
 void close()
          Deprecated. Closes the Jar archive by creating the manifest, and signing the archive.
 void writeFile(java.io.File inputFile, java.lang.String jarPath)
          Deprecated. Writes a new File into the archive.
 void writeZip(java.io.InputStream input, SignedJarBuilder.IZipEntryFilter filter)
          Deprecated. Copies the content of a Jar/Zip archive into the receiver archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedJarBuilder

public SignedJarBuilder(java.io.OutputStream out,
                        java.security.PrivateKey key,
                        java.security.cert.X509Certificate certificate)
                 throws java.io.IOException,
                        java.security.NoSuchAlgorithmException
Deprecated. 
Creates a SignedJarBuilder with a given output stream, and signing information.

If either key or certificate is null then the archive will not be signed.

Parameters:
out - the OutputStream where to write the Jar archive.
key - the PrivateKey used to sign the archive, or null.
certificate - the X509Certificate used to sign the archive, or null.
Throws:
java.io.IOException
java.security.NoSuchAlgorithmException
Method Detail

writeFile

public void writeFile(java.io.File inputFile,
                      java.lang.String jarPath)
               throws java.io.IOException
Deprecated. 
Writes a new File into the archive.

Parameters:
inputFile - the File to write.
jarPath - the filepath inside the archive.
Throws:
java.io.IOException

writeZip

public void writeZip(java.io.InputStream input,
                     SignedJarBuilder.IZipEntryFilter filter)
              throws java.io.IOException,
                     SignedJarBuilder.IZipEntryFilter.ZipAbortException
Deprecated. 
Copies the content of a Jar/Zip archive into the receiver archive.

An optional SignedJarBuilder.IZipEntryFilter allows to selectively choose which files to copy over.

Parameters:
input - the InputStream for the Jar/Zip to copy.
filter - the filter or null
Throws:
java.io.IOException
SignedJarBuilder.IZipEntryFilter.ZipAbortException - if the SignedJarBuilder.IZipEntryFilter filter indicated that the write must be aborted.

close

public void close()
           throws java.io.IOException,
                  java.security.GeneralSecurityException,
                  java.lang.Exception
Deprecated. 
Closes the Jar archive by creating the manifest, and signing the archive.

Throws:
java.io.IOException
java.security.GeneralSecurityException
java.lang.Exception

cleanUp

public void cleanUp()
Deprecated. 
Clean up of the builder for interrupted workflow. This does nothing if close() was called successfully.