openlsd.server.admin
Class LSDCheckSimilar

java.lang.Object
  extended by openlsd.server.admin.commoncheck.LSDCheckSimilarAbstract
      extended by openlsd.server.admin.LSDCheckSimilar

public class LSDCheckSimilar
extends LSDCheckSimilarAbstract

This class is about to check if a specific file is already inserted in one specific Legacy of OpenLSD. It checks first the existence of one file with same length and MD5, then, if there is at least one, it checks if the files are really the same.
WARNING: This function is only compatible with not crypted Legacy!

WARNING: This function needs (for efficiency) to add the index IDX_DOC_LIDSIZEDOCMD5 in the database.
This version can only be used on the OpenLSD Server due to the necessity to get direct access on files stored in OpenLSD Legacy.

Author:
Frederic BREGIER LGPL 2008

Field Summary
static LSDLoadConfig llc
          Object to load XML configuration
 
Fields inherited from class openlsd.server.admin.commoncheck.LSDCheckSimilarAbstract
admin, lsdlegacy
 
Constructor Summary
LSDCheckSimilar(LSDDbAdmin admin, LSDLegacy legacy)
          Create the CheckSimilar object from other main
LSDCheckSimilar(LSDLoadConfig llc)
          Create the CheckSimilar object from Main procedure
 
Method Summary
 void clean()
          Clean object
static void main(java.lang.String[] args)
          Check if a specific file is already inserted in one specific Legacy of OpenLSD.
 
Methods inherited from class openlsd.server.admin.commoncheck.LSDCheckSimilarAbstract
getIfExists, getIfExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

llc

public static LSDLoadConfig llc
Object to load XML configuration

Constructor Detail

LSDCheckSimilar

public LSDCheckSimilar(LSDLoadConfig llc)
Create the CheckSimilar object from Main procedure

Parameters:
llc -

LSDCheckSimilar

public LSDCheckSimilar(LSDDbAdmin admin,
                       LSDLegacy legacy)
Create the CheckSimilar object from other main

Parameters:
admin -
legacy -
Method Detail

main

public static void main(java.lang.String[] args)
Check if a specific file is already inserted in one specific Legacy of OpenLSD.
Returns 0 if this file does not exist already in the Legacy, else if it exists it returns 1 and prints to stdout the LSD index of the existing document.

Parameters:
args - with the config filename (db config) as first arg, then the LSD config filename as second arg, then the Legacy id as third arg, then the path to the file to check as fourth arg.

clean

public void clean()
Clean object

Overrides:
clean in class LSDCheckSimilarAbstract