Changeset b6e7c18


Ignore:
Timestamp:
Mar 28, 2011 8:43:02 AM (8 years ago)
Author:
Ted Faber <faber@…>
Branches:
abac0-leak, abac0-mei, compt_changes, gec13, master, mei-id, mei-rt0-n, mei_rt0, mei_rt2, mei_rt2_fix_1, meiyap-rt1, meiyap1, rt2, tvf-new-xml
Children:
3d13073
Parents:
4ab0561
Message:

Put directory in zipfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/net/deterlab/abac/Context.java

    r83cdf0f rb6e7c18  
    799799        ZipOutputStream z = new ZipOutputStream(new FileOutputStream(f));
    800800        Set<Identity> ids = allIDs ?  m_identities : new TreeSet<Identity>();
     801        String baseDir = f.getName();
     802        int idx = baseDir.indexOf('.');
     803
     804
     805        if (idx != -1)
     806            baseDir = baseDir.substring(0, idx);
    801807
    802808        int n = 0;
    803809        for (Credential c: credentials()) {
    804             z.putNextEntry(new ZipEntry("attr" + n++  + ".der"));
     810            z.putNextEntry(new ZipEntry(baseDir + File.separator +
     811                        "attr" + n++  + ".der"));
    805812            c.write(z);
    806813            z.closeEntry();
     
    808815        }
    809816        for (Identity i: ids) {
    810             z.putNextEntry(new ZipEntry(i.getName() + ".pem"));
     817            z.putNextEntry(new ZipEntry(baseDir + File.separator +
     818                        i.getName() + ".pem"));
    811819            i.write(z);
    812820            if (withPrivateKeys)
Note: See TracChangeset for help on using the changeset viewer.