openlsd.server.admin.commoncheck
Class LSDCheckSimilarAbstract

java.lang.Object
  extended by openlsd.server.admin.commoncheck.LSDCheckSimilarAbstract
Direct Known Subclasses:
LSDCheckSimilar

public abstract class LSDCheckSimilarAbstract
extends java.lang.Object

This abstract 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.

Author:
Frederic BREGIER LGPL 2008

Field Summary
protected  LSDDbAdmin admin
          The DBAdmin connector
protected  LSDLegacy lsdlegacy
          The LSD Legacy object
 
Constructor Summary
LSDCheckSimilarAbstract()
           
 
Method Summary
 void clean()
          Clean object
 LSDExtDbDocument getIfExists(java.io.File file)
          Returns the Document if it exists, else null
 LSDExtDbDocument getIfExists(java.lang.String filepath)
          Returns the Document if it exists, else null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

admin

protected LSDDbAdmin admin
The DBAdmin connector


lsdlegacy

protected LSDLegacy lsdlegacy
The LSD Legacy object

Constructor Detail

LSDCheckSimilarAbstract

public LSDCheckSimilarAbstract()
Method Detail

getIfExists

public LSDExtDbDocument getIfExists(java.lang.String filepath)
Returns the Document if it exists, else null

Parameters:
filepath -
Returns:
the Document if it exists, else null

getIfExists

public LSDExtDbDocument getIfExists(java.io.File file)
Returns the Document if it exists, else null

Parameters:
file - to check if it exists
Returns:
the Document if it exists, else null

clean

public void clean()
Clean object