Changeset 6432e35


Ignore:
Timestamp:
Mar 26, 2011 1:52:34 PM (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:
1b88de8
Parents:
a5cfe93
Message:

Rename to match libabac specs

Location:
java
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • java/GraphTest.java

    rd69593c r6432e35  
    3232            try {
    3333                if (f.isDirectory())
    34                     ctxt.readDirectory(f, errs);
     34                    ctxt.load_directory(f, errs);
    3535                else if (f.getPath().endsWith(".pem"))
    36                     ctxt.loadIDFile(f);
     36                    ctxt.load_id_file(f);
    3737                else if (f.getPath().endsWith(".der"))
    38                     ctxt.loadAttributeFile(f);
     38                    ctxt.load_attribute_file(f);
    3939                else if (f.getPath().endsWith(".zip"))
    40                     ctxt.readZipFile(f, errs);
     40                    ctxt.load_zip_file(f, errs);
    4141                else
    4242                    System.out.println(f + " of unknown type");
     
    7777            i.write(fn + n++ + suf);
    7878        }
    79         ctxt.writeZipFile(new File("./testout.zip"), true, true);
     79        ctxt.write_zip_file(new File("./testout.zip"), true, true);
    8080    }
    8181}
  • java/net/deterlab/abac/Context.java

    re36ea1d r6432e35  
    114114        this();
    115115        for (Identity i: c.identities)
    116             loadIDChunk(i);
     116            load_id_chunk(i);
    117117        for (Credential cr: c.credentials())
    118             loadAttributeChunk(cr);
     118            load_attribute_chunk(cr);
    119119        derive_implied_edges();
    120120    }
     
    125125     * @return one of the static int return codes.
    126126     */
    127     public int loadIDFile(String fn) { return loadIDChunk(new File(fn)); }
     127    public int load_id_file(String fn) { return load_id_chunk(new File(fn)); }
    128128    /**
    129129     * Load an Identity from a file.
     
    131131     * @return one of the static int return codes.
    132132     */
    133     public int loadIDFile(File fn) { return loadIDChunk(fn); }
     133    public int load_id_file(File fn) { return load_id_chunk(fn); }
    134134    /**
    135135     * Load an Identity from an object.  Supported objects are an Identity, a
     
    140140     * @return one of the static int return codes.
    141141     */
    142     public int loadIDChunk(Object c) {
     142    public int load_id_chunk(Object c) {
    143143        try {
    144144            if (c instanceof Identity)
     
    167167     * @return one of the static int return codes.
    168168     */
    169     public int loadAttributeFile(String fn) {
    170         return loadAttributeChunk(new File(fn));
     169    public int load_attribute_file(String fn) {
     170        return load_attribute_chunk(new File(fn));
    171171    }
    172172
     
    176176     * @return one of the static int return codes.
    177177     */
    178     public int loadAttributeFile(File fn) { return loadAttributeChunk(fn); }
     178    public int load_attribute_file(File fn) { return load_attribute_chunk(fn); }
    179179
    180180    /**
     
    186186     * @return one of the static int return codes.
    187187     */
    188     public int loadAttributeChunk(Object c) {
     188    public int load_attribute_chunk(Object c) {
    189189        try {
    190190            if (c instanceof Credential)
     
    436436     * common name they are disambiguated.  Only one entry for keyid is
    437437     * allowed.
    438      * @param i the Identity to add
     438     * @param id the Identity to add
    439439     */
    440440    protected void addIdentity(Identity id) {
     
    499499     * alias files into the two maps.  If keys is not null, any key pairs in
    500500     * PEM files are put in there.  If errors is not null, errors reading files
    501      * are added indexed by filename.
     501     * are added indexed by filename.  This is a jabac extension.
    502502     * @param zf the File to read
    503503     * @param keys a Collection into which to insert unmatched keys
     
    506506     *                     returned in the errors parameter.
    507507     */
    508     public void readZipFile(File zf, Collection<KeyPair> keys,
     508    public void load_zip_file(File zf, Collection<KeyPair> keys,
    509509            Map<String, Exception> errors) throws IOException {
    510510        Vector<ZipEntry> derEntries = new Vector<ZipEntry>();
     
    534534                            ids.put(i.getKeyID(), i);
    535535
    536                         loadIDChunk(i);
     536                        load_id_chunk(i);
    537537                    }
    538538                    else if (o instanceof KeyPair ) {
     
    572572    }
    573573    /**
    574      * Equivalent to readZipFile(d, null, null).
     574     * Equivalent to load_zip_file(d, null, null).
    575575     * @param d the File to read
    576576     * @throws IOException if the file is unreadable. To see per-entry
    577577     *                      exceptions use a signature with the errors parameter
    578578     */
    579     public void readZipFile(File d)
     579    public void load_zip_file(File d)
    580580            throws IOException {
    581         readZipFile(d, null, null);
    582     }
    583     /**
    584      * Equivalent to readZipFile(d, null, errors).
     581        load_zip_file(d, null, null);
     582    }
     583    /**
     584     * Equivalent to load_zip_file(d, null, errors).
    585585     * @param d the File to read
    586586     * @param errors a Map from entry name to generated exception
     
    588588     *                     returned in the errors parameter.
    589589     */
    590     public void readZipFile(File d,
     590    public void load_zip_file(File d,
    591591            Map<String, Exception> errors) throws IOException {
    592         readZipFile(d, null, errors);
    593     }
    594     /**
    595      * Equivalent to readZipFile(d, keys, null).
     592        load_zip_file(d, null, errors);
     593    }
     594    /**
     595     * Equivalent to load_zip_file(d, keys, null).
    596596     * @param d the File to read
    597597     * @param keys a Collection into which to insert unmatched keys
     
    599599     *                      exceptions use a signature with the errors parameter
    600600     */
    601     public void readZipFile(File d,
     601    public void load_zip_file(File d,
    602602            Collection<KeyPair> keys) throws IOException {
    603         readZipFile(d, keys, null);
     603        load_zip_file(d, keys, null);
    604604    }
    605605
     
    655655     * alias files into the two maps.  If keys is not null, any key pairs in
    656656     * PEM files are put in there.  If errors is not null, errors reading files
    657      * are added indexed by filename.
     657     * are added indexed by filename.  This behaves slightly differently from
     658     * the load_directory description in the general libabac documentation.
    658659     * @param d the File to read.  If it is a directory its contents are read
    659660     * @param keys a Collection into which to insert unmatched keys
     
    662663     *                     returned in the errors parameter.
    663664     */
    664     public void readDirectory(File d, Collection<KeyPair> keys,
     665    public void load_directory(File d, Collection<KeyPair> keys,
    665666            Map<String, Exception> errors) {
    666667        Vector<File> derFiles = new Vector<File>();
     
    691692                            ids.put(i.getKeyID(), i);
    692693
    693                         loadIDChunk(i);
     694                        load_id_chunk(i);
    694695                    }
    695696                    else if (o instanceof KeyPair ) {
     
    729730    }
    730731    /**
    731      * Equivalent to readDirectory(d, null, null).
     732     * Equivalent to load_directory(d, null, null).
    732733     * @param d the File to read.  If it is a directory its contents are read
    733734     * @throws IOException if the file is unreadable.  To see per-file
    734735     *                     exceptions use a signature with the errors parameter.
    735736     */
    736     public void readDirectory(File d) {
    737         readDirectory(d, null, null);
    738     }
    739     /**
    740      * Equivalent to readDirectory(d, null, null).
     737    public void load_directory(File d) {
     738        load_directory(d, null, null);
     739    }
     740    /**
     741     * Equivalent to load_directory(d, null, null).
    741742     * @param d the File to read.  If it is a directory its contents are read
    742743     * @param errors a Map from entry name to generated exception
     
    744745     *                     returned in the errors parameter.
    745746     */
    746     public void readDirectory(File d, Map<String, Exception> errors) {
    747         readDirectory(d, null, errors);
    748     }
    749     /**
    750      * Equivalent to readDirectory(d, null, null).
     747    public void load_directory(File d, Map<String, Exception> errors) {
     748        load_directory(d, null, errors);
     749    }
     750    /**
     751     * Equivalent to load_directory(d, null, null).
    751752     * @param d the File to read.  If it is a directory its contents are read
    752753     * @param keys a Collection into which to insert unmatched keys
     
    754755     *                     exceptions use a signature with the errors parameter.
    755756     */
    756     public void readDirectory(File d, Collection<KeyPair> keys) {
    757         readDirectory(d, keys, null);
     757    public void load_directory(File d, Collection<KeyPair> keys) {
     758        load_directory(d, keys, null);
    758759    }
    759760
     
    768769     * @throws IOException if there is a problem writhing the file.
    769770     */
    770     public void writeZipFile(File f, boolean allIDs, boolean withPrivateKeys)
     771    public void write_zip_file(File f, boolean allIDs, boolean withPrivateKeys)
    771772            throws IOException {
    772773        ZipOutputStream z = new ZipOutputStream(new FileOutputStream(f));
Note: See TracChangeset for help on using the changeset viewer.