felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Elen (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-410) Add support for zipped repository files
Date Thu, 25 Oct 2007 11:37:53 GMT
Add support for zipped repository files

                 Key: FELIX-410
                 URL: https://issues.apache.org/jira/browse/FELIX-410
             Project: Felix
          Issue Type: Improvement
          Components: Bundle Repository (OBR)
    Affects Versions: 1.0.0
            Reporter: Bart Elen
             Fix For: 1.0.0

The repository XML-file can become relative large when the number of bundles grows. 
The bindex tool reduces the size of the repository file significantly when it's zip function
is used (with -r repository.zip)
usage example:
java -jar bindex.jar bundleDir -r repository.zip

The problem is that OBR does not seem to support zipped repository files.

A solution that does the trick is:

Replace in RepositoryImpl.java line 146 "is = conn.getInputStream();" of function  "private
void parseRepositoryFile(int hopCount)"

			if ( m_url.getPath().endsWith(".zip")) {
				ZipInputStream zin = new ZipInputStream( conn.getInputStream() );
				ZipEntry entry = zin.getNextEntry();
				while ( entry != null ) {
					if ( entry.getName().equals("repository.xml")) {
						is = zin;
					entry = zin.getNextEntry();
			} else {
				is = conn.getInputStream();

And add following imports:
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message