Using NamedSource to provide DROID with external signature

Issue #65 resolved
Laurent Bihanic
created an issue

In addition to URLSource, ZipFileSource (but also forthcoming GzipMemberSource and ArcRecordSource) implement NamedSource to expose the name of the files found in a container (Zip, GZip, ARC...). The DROID wrapper could test on NamedSource to provide DROID with externale signature rather than testing explicitely each implementation

The following code fragment: {{{ else if (source instanceof URLSource){ // set the path so DROID will make use of external signatures as well as internal ones identificationFile.setFilePath(((URLSource)source).getSourceName()); } }}} could be replaced by: {{{ else if (source instanceof NamedSource) { // URLSource, ZipFileSource, GzipMemberSource... String src = ((NamedSource)source).getSourceName(); if ((src != null) && (src.length() != 0)) { // set the path so DROID will make use of external // signatures as well as internal ones identificationFile.setFilePath(src); } } }}}

Comments (4)

  1. Log in to comment