Skip to content

Commit

Permalink
FAB-16166 Switch to metadata.json for packaging
Browse files Browse the repository at this point in the history
The patch switches to using the new preferred name for the metadata
file.

Change-Id: I5e46d08aac4b92df75b49c81cea21f3ae6ab104a
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Aug 7, 2019
1 parent 082ba50 commit a4a074c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static LifecycleChaincodePackage fromSource(String label, Path chaincodeS
TarArchiveOutputStream archiveOutputStream = new TarArchiveOutputStream(new GzipCompressorOutputStream(bos));
archiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);

TarArchiveEntry archiveEntry = new TarArchiveEntry("Chaincode-Package-Metadata.json");
TarArchiveEntry archiveEntry = new TarArchiveEntry("metadata.json");
archiveEntry.setMode(0100644);
archiveEntry.setSize(mataDataBytes.length);
archiveOutputStream.putArchiveEntry(archiveEntry);
Expand Down Expand Up @@ -336,7 +336,7 @@ public JsonObject getMetaInfJson() throws IOException {

TarArchiveEntry currentEntry = tarInput.getNextTarEntry();
while (currentEntry != null) {
if (currentEntry.getName().equals("Chaincode-Package-Metadata.json")) {
if (currentEntry.getName().equals("metadata.json")) {
byte[] buf = new byte[(int) currentEntry.getSize()];
tarInput.read(buf, 0, (int) currentEntry.getSize());

Expand All @@ -362,7 +362,7 @@ public byte[] getChaincodePayloadBytes() throws IOException {

TarArchiveEntry currentEntry = tarInput.getNextTarEntry();
while (currentEntry != null) {
if (!currentEntry.getName().equals("Chaincode-Package-Metadata.json")) { // right now anything but this
if (!currentEntry.getName().equals("metadata.json")) { // right now anything but this
byte[] buf = new byte[(int) currentEntry.getSize()];
tarInput.read(buf, 0, (int) currentEntry.getSize());

Expand Down

0 comments on commit a4a074c

Please sign in to comment.