nina08 | bonjours tous le monde
Je dois rajouter un module a un logicile open source "jhove"
Je l'ai rajouté dans le repetroire: /home/jhove/classes/edu/harvard/hul/ois/jhove/module/Project/
la compilation a très bien marché.
j'ai aussi rajoué:
EXTRA_JARS=/home/jhove/classes/edu/harvard/hul/ois/jhove/module/Project/WarcModule.jar home/jhove/classes/edu/harvard/hul/ois/jhove/module/Project/jhove.jar:
au fichier jhove.tmpl
puis j'ai rajouté à jhove.conf le code suivant comme ils ont dis ds la documentaion:
<module>
<class>MonModule</class>
</module>
j'ai même essayé de rajouter:
<module>
<class>edu.harvard.hul.ois.jhove.module.Project.MonModule</class>
</module>
Mais j'ai cette erreur:
edu.harvard.hul.ois.jhove.JhoveException: cannot instantiate module: WarcModule
at edu.harvard.hul.ois.jhove.JhoveBase.init(Unknown Source)
at Jhove.main(Unknown Source)
Normalement c'est un problème de classpath ou de package.
Je suis bloqué sur ce point, svp aidez moi.
Voici mon code:
Code :
- import java.io.File;
- import java.util.*;
- import java.io.*;
- //import org.archive.io.warc.*;
- import edu.harvard.hul.ois.jhove.*;
- import edu.harvard.hul.ois.jhove.ModuleBase;
- import edu.harvard.hul.ois.jhove.RepInfo;
- import org.archive.io.warc.*;
- public class MonModule extends ModuleBase
- {
- private static final String NAME = "Warc-hul";
- private static final String RELEASE = "1.7";
- private static final int [] DATE = {2008, 9, 23};
- private static final String [] FORMAT = { "warc"};
- private static final String COVERAGE =
- "PDF 1.0-1.6; PDF/X-1 (ISO 15930-1:2001), X-1a (ISO 15930-4:2003), " +
- "X-2 (ISO 15930-5:2003), and X-3 (ISO 15930-6:2003); Tagged PDF; " +
- "Linearized PDF; PDF/A (ISO/CD 19005-1)";
- private static final String [] MIMETYPE = {"application/warc"};
- private static final String WELLFORMED = "A PDF file is " +
- "well-formed if it meets the criteria defined in Chapter " +
- "3 of the PDF Reference 1.6 (5th edition, 2004)";
- private static final String VALIDITY = null;
- private static final String REPINFO = null;
- private static final String NOTE = "This module does *not* validate " +
- "data within content streams (including operators) or encrypted data";
- private static final String RIGHTS = "Copyright 2003-2007 by JSTOR and " +
- "the President and Fellows of Harvard College. " +
- "Released under the GNU Lesser General Public License.";
- private static final String ENCRYPTED = "<May be encrypted>";
-
-
-
-
-
- protected MonModule(String NAME, String RELEASE, int[] DATE, String[] FORMAT, String COVERAGE, String[] MIMETYPE, String WELLFORMED, String VALIDITY, String REPINFO, String NOTE, String RIGHTS, boolean x)
- {
- super (NAME, RELEASE, DATE, FORMAT, COVERAGE, MIMETYPE, WELLFORMED,VALIDITY, REPINFO, NOTE, RIGHTS, true);
-
- }
- /******************************************************************
- * PRIVATE INSTANCE FIELDS.
- ******************************************************************/
- /* First 6 bytes of file */
- protected byte _sig[];
- /* Checksummer object */
- protected Checksummer _ckSummer;
- /* XMP property */
- protected Property _xmpProp;
- /* Input stream wrapper which handles checksums */
- protected ChecksumInputStream _cstream;
- /* Data input stream wrapped around _cstream */
- protected DataInputStream _dstream;
- /* Flag for presence of global color table */
- protected boolean _globalColorTableFlag;
- /* Size of global color table */
- protected int _globalColorTableSize;
- /* Count of graphic control extensions preceding
- * something to modify */
- protected int _gceCounter;
- /* Top-level metadata property */
- protected Property _metadata;
- /* Blocks list property */
- protected List _blocksList;
- /* Total count of graphic and plain text extension blocks */
- protected int _numGraphicBlocks;
- public void checkSignatures (File file, InputStream stream, RepInfo info)
- throws IOException
- {
- int sigBytes[] = { 'W', 'A', 'R', 'C'};
- int i;
- int ch;
- try {
- _dstream = null;
- _dstream = getBufferedDataStream (stream, _je != null ?
- _je.getBufferSize () : 0);
- for (i = 0; i < 4; i++) {
- ch = readUnsignedByte(_dstream, this);
- if (ch != sigBytes[i]) {
- info.setWellFormed (false);
- return;
- }
- }
- info.setModule (this);
- info.setFormat (_format[0]);
- info.setMimeType (_mimeType[0]);
- info.setSigMatch(_name);
- }
- catch (Exception e) {
- // Reading a very short file may take us here.
- info.setWellFormed (false);
- return;
- }
- }
|
Merci d'avance pour tout aide. |