Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
ctron/package-drone#144 catch the case of an illegal OSGi version
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Mar 16, 2016
1 parent efb5b41 commit 4c18918
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Import-Package: com.google.common.hash;version="18.0.0",
org.eclipse.packagedrone.utils;version="1.0.0",
org.eclipse.packagedrone.utils.io;version="1.0.0",
org.eclipse.packagedrone.utils.xml;version="1.0.0",
org.eclipse.scada.utils;version="0.2.0",
org.osgi.framework;version="1.7.0",
org.slf4j;version="1.7.2"
Service-Component: OSGI-INF/hash.xml,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2015 IBH SYSTEMS GmbH.
* Copyright (c) 2014, 2016 IBH SYSTEMS GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -28,6 +28,7 @@
import org.eclipse.packagedrone.repo.utils.osgi.bundle.BundleInformationParser;
import org.eclipse.packagedrone.repo.utils.osgi.feature.FeatureInformation;
import org.eclipse.packagedrone.repo.utils.osgi.feature.FeatureInformationParser;
import org.eclipse.scada.utils.ExceptionHelper;
import org.osgi.framework.Constants;

import com.google.common.io.ByteStreams;
Expand Down Expand Up @@ -102,7 +103,6 @@ private void extractBundleInformation ( final Extractor.Context context, final M
final BundleInformation bi;
try ( ZipFile zipFile = new ZipFile ( context.getPath ().toFile () ) )
{

final ZipEntry m = zipFile.getEntry ( JarFile.MANIFEST_NAME );
if ( m == null )
{
Expand All @@ -125,7 +125,15 @@ private void extractBundleInformation ( final Extractor.Context context, final M
manifest = new Manifest ( is );
}

bi = new BundleInformationParser ( zipFile, manifest ).parse ();
try
{
bi = new BundleInformationParser ( zipFile, manifest ).parse ();
}
catch ( final Exception e )
{
context.validationError ( ExceptionHelper.getMessage ( e ) );
return;
}
if ( bi == null )
{
return;
Expand Down

0 comments on commit 4c18918

Please sign in to comment.